fix(deploy): merge volumes from stack init() instead of overwriting
Some checks failed
Lint Checks / Run linter (push) Has been cancelled
Lint Checks / Run linter (pull_request) Successful in 24m14s
Deploy Test / Run deploy test suite (pull_request) Successful in 29m14s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 33m1s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Failing after 34m3s
Webapp Test / Run webapp test suite (pull_request) Successful in 33m23s
Smoke Test / Run basic test suite (pull_request) Successful in 33m49s

Previously, volumes defined in a stack's commands.py init() function
were being overwritten by volumes discovered from compose files.
This prevented stacks from adding infrastructure volumes like caddy-data
that aren't defined in the compose files.

Now volumes are merged, with init() volumes taking precedence over
compose-discovered defaults.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
A. F. Dudley 2026-01-25 17:27:51 -05:00
parent 79b7870a6a
commit 6ff3da76ee

View File

@ -469,7 +469,10 @@ def init_operation(
# Docker Compose and kind: use relative paths
volume_descriptors[named_volume] = f"./data/{named_volume}"
if volume_descriptors:
spec_file_content["volumes"] = volume_descriptors
# Merge with existing volumes from stack init()
# init() volumes take precedence over compose defaults
orig_volumes = spec_file_content.get("volumes", {})
spec_file_content["volumes"] = {**volume_descriptors, **orig_volumes}
if configmap_descriptors:
spec_file_content["configmaps"] = configmap_descriptors