feat: add label-based reconciliation pause support#25
Closed
veerendra2 wants to merge 3 commits into
Closed
Conversation
Add support for pausing reconciliation on specific stacks using a label.
When a stack has the label 'composeflux.reconciliation.pause=true',
ComposeFlux will skip all reconciliation operations for that stack.
Use case:
- Database backups (e.g., Kopia backing up PostgreSQL)
- Maintenance operations requiring containers to stay stopped
- Temporary exclusion from automated deployments
Changes:
- Add LabelReconciliationPause constant
- Add isReconciliationPaused() helper function
- Skip paused stacks in Sync() - no deployment
- Skip paused stacks in SyncImages() - no image updates
- Skip paused stacks in Prune() - no removal even if deleted from Git
Usage:
Add label to compose file or via Docker CLI:
labels:
composeflux.reconciliation.pause: "true"
Or using Docker CLI:
docker container update --label-add composeflux.reconciliation.pause=true <container>
Fixes #22
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add GitHub repo badge to docs/index.md - Document the pause label feature in Introduction.md - Emphasize Docker CLI usage (no Git changes required) - Include usage examples for Docker CLI and backup scenarios - Show compose file option as alternative for permanent pause Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32c9c36 to
bc177da
Compare
ContainerPrune removes ALL stopped containers, including those from paused stacks (composeflux.reconciliation.pause=true). This would delete containers stopped for backups or maintenance. ComposeFlux already manages container lifecycle via Down() in the Prune() function, so ContainerPrune is not needed. Changes: - Comment out ContainerPrune call with explanation - Add reference to issue #22 - Keep other resource pruning (images, volumes, networks, build cache) Fixes #22 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Closing this PR. After testing, simply disabling ContainerPrune is sufficient to solve the issue. The label-based pause feature is not needed. See #26 for the simpler solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for pausing reconciliation on specific stacks using a label. When a stack has the label
composeflux.reconciliation.pause=true, ComposeFlux will skip all reconciliation operations for that stack.Key feature: Add the label via Docker CLI without modifying Git - perfect for temporary operations like backups.
Problem (Fixes #22)
During database backups (e.g., Kopia backing up PostgreSQL), containers must stay stopped. ComposeFlux should not touch these stacks during reconciliation to prevent data corruption.
Solution
Add a label-based pause mechanism that completely excludes stacks from reconciliation:
composeflux.reconciliation.pause=trueSync()SyncImages()Usage
Recommended: Docker CLI (no Git changes)
Example: Backup workflow
Alternative: Compose file (permanent pause)
Changes
LabelReconciliationPauseconstantisReconciliationPaused()helper functionSync(),SyncImages(), andPrune()Files Changed
internal/reconcile/deploy.go- Add label constantinternal/reconcile/prune.go- Add helper function, skip paused stacksinternal/reconcile/sync.go- Skip paused stacks in sync and image updatesdocs/Introduction.md- Document pause label featuredocs/index.md- Add GitHub badge🤖 Generated with Claude Code