Copy config under a volume for Docker too (similar to a configmap).
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 39s
Smoke Test / Run basic test suite (pull_request) Successful in 4m6s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m39s
Deploy Test / Run deploy test suite (pull_request) Successful in 4m56s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 7m39s

This commit is contained in:
Thomas E Lackey 2024-08-08 22:25:25 -05:00
parent 1def279d26
commit 09479e605c

View File

@ -520,6 +520,16 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, netw
if os.path.exists(source_config_dir): if os.path.exists(source_config_dir):
destination_config_dir = deployment_dir_path.joinpath("configmaps", configmap) destination_config_dir = deployment_dir_path.joinpath("configmaps", configmap)
copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True) copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True)
else:
# TODO: We should probably only do this if the volume is marked :ro.
for volume_name, volume_path in parsed_spec.get_volumes().items():
source_config_dir = resolve_config_dir(stack_name, volume_name)
# Only copy if the source exists and is _not_ empty.
if os.path.exists(source_config_dir) and os.listdir(source_config_dir):
destination_config_dir = deployment_dir_path.joinpath(volume_path)
# Only copy if the destination exists and _is_ empty.
if os.path.exists(destination_config_dir) and not os.listdir(destination_config_dir):
copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True)
# Delegate to the stack's Python code # Delegate to the stack's Python code
# The deploy create command doesn't require a --stack argument so we need to insert the # The deploy create command doesn't require a --stack argument so we need to insert the