fix(k8s): copy configmap dirs for jobs-only stacks during deploy create
Some checks failed
Lint Checks / Run linter (pull_request) Failing after 2m2s
Deploy Test / Run deploy test suite (pull_request) Successful in 4m55s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 5m47s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Failing after 6m38s
Webapp Test / Run webapp test suite (pull_request) Failing after 7m34s
Smoke Test / Run basic test suite (pull_request) Successful in 5m58s

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>
This commit is contained in:
Prathamesh Musale 2026-03-03 14:26:20 +00:00
parent 50fd116ead
commit dc60695100

View File

@ -985,17 +985,7 @@ def _write_deployment_files(
script_paths = get_pod_script_paths(parsed_stack, pod)
_copy_files_to_directory(script_paths, destination_script_dir)
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
)
else:
if not parsed_spec.is_kubernetes_deployment():
# TODO:
# This is odd - looks up config dir that matches a volume name,
# then copies as a mount dir?
@ -1017,6 +1007,19 @@ def _write_deployment_files(
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
jobs = get_job_list(parsed_stack)
if jobs: