fix(k8s): copy configmap dirs for jobs-only stacks during deploy create
The k8s configmap directory copying was inside the `for pod in pods:` loop. For jobs-only stacks (no pods), the loop never executes, so configmap files were never copied into the deployment directory. The ConfigMaps were created as empty objects, leaving volume mounts with no files. Move the k8s configmap copying outside the pod loop so it runs regardless of whether the stack has pods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>test-ci
parent
50fd116ead
commit
dc60695100
|
|
@ -985,17 +985,7 @@ def _write_deployment_files(
|
||||||
script_paths = get_pod_script_paths(parsed_stack, pod)
|
script_paths = get_pod_script_paths(parsed_stack, pod)
|
||||||
_copy_files_to_directory(script_paths, destination_script_dir)
|
_copy_files_to_directory(script_paths, destination_script_dir)
|
||||||
|
|
||||||
if parsed_spec.is_kubernetes_deployment():
|
if not parsed_spec.is_kubernetes_deployment():
|
||||||
for configmap in parsed_spec.get_configmaps():
|
|
||||||
source_config_dir = resolve_config_dir(stack_name, configmap)
|
|
||||||
if os.path.exists(source_config_dir):
|
|
||||||
destination_config_dir = target_dir.joinpath(
|
|
||||||
"configmaps", configmap
|
|
||||||
)
|
|
||||||
copytree(
|
|
||||||
source_config_dir, destination_config_dir, dirs_exist_ok=True
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# This is odd - looks up config dir that matches a volume name,
|
# This is odd - looks up config dir that matches a volume name,
|
||||||
# then copies as a mount dir?
|
# then copies as a mount dir?
|
||||||
|
|
@ -1017,6 +1007,19 @@ def _write_deployment_files(
|
||||||
dirs_exist_ok=True,
|
dirs_exist_ok=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Copy configmap directories for k8s deployments (outside the pod loop
|
||||||
|
# so this works for jobs-only stacks too)
|
||||||
|
if parsed_spec.is_kubernetes_deployment():
|
||||||
|
for configmap in parsed_spec.get_configmaps():
|
||||||
|
source_config_dir = resolve_config_dir(stack_name, configmap)
|
||||||
|
if os.path.exists(source_config_dir):
|
||||||
|
destination_config_dir = target_dir.joinpath(
|
||||||
|
"configmaps", configmap
|
||||||
|
)
|
||||||
|
copytree(
|
||||||
|
source_config_dir, destination_config_dir, dirs_exist_ok=True
|
||||||
|
)
|
||||||
|
|
||||||
# Copy the job files into the target dir
|
# Copy the job files into the target dir
|
||||||
jobs = get_job_list(parsed_stack)
|
jobs = get_job_list(parsed_stack)
|
||||||
if jobs:
|
if jobs:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue