forked from cerc-io/stack-orchestrator
fix(deploy): merge volumes from stack init() instead of overwriting
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:
parent
6a2bbae250
commit
76c0c17c3b
@ -468,7 +468,10 @@ def init_operation(
|
|||||||
else:
|
else:
|
||||||
volume_descriptors[named_volume] = f"./data/{named_volume}"
|
volume_descriptors[named_volume] = f"./data/{named_volume}"
|
||||||
if volume_descriptors:
|
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:
|
if configmap_descriptors:
|
||||||
spec_file_content["configmaps"] = configmap_descriptors
|
spec_file_content["configmaps"] = configmap_descriptors
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user