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>
parent
55b76b9b57
commit
bb44145510
|
|
@ -465,7 +465,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