feat: add confirmation label when volume spec changes#13808
Conversation
7eb9d7d to
76c9cda
Compare
close: docker#13807 Signed-off-by: qianlongzt <18493471+qianlongzt@users.noreply.github.com>
76c9cda to
395e345
Compare
|
This is a useful feature for CD pipeline automation — the interactive volume recreation prompt is a common friction point in CI/CD environments. A few thoughts on the implementation: Label naming convention
Scope: volumes only, or also other resources?The same "recreate on spec change" problem applies to networks (e.g., network subnet changes) and potentially configs/secrets. While it's fine to scope this PR to volumes only, it would be worth noting in the PR description whether this label pattern is intended to be extensible to other resource types in the future, or if it's intentionally volume-specific. Safety consideration: data loss riskReproducing a named volume destroys existing data. The label effectively silences a prompt that exists specifically to prevent accidental data loss. The implementation should clearly document this in:
CI workflow exampleA concrete usage example in the PR description would help reviewers understand the target use case: volumes:
my_data:
labels:
com.docker.compose.volume.recreate-when-spec-updated: "true"This makes it immediately clear whether the label value matters (boolean string) or just the presence of the label key is sufficient. Good feature for automation-first workflows. The main thing I'd want to see before merge is explicit data-loss documentation. |
What I did
Add support for label:
com.docker.compose.volume.recreate-when-spec-updatedThis allows automatic handling of volume recreation when specs change, improving compatibility with CD workflows by avoiding interactive prompts.
Related issue
closes: #13807
(not mandatory) A picture of a cute animal, if possible in relation to what you did