Skip to content

fix: enable kubedog tracking with atomic/rollback-on-failure helm flags#2450

Open
yxxhero wants to merge 2 commits intomainfrom
fix/kubedog-atomic-rollback
Open

fix: enable kubedog tracking with atomic/rollback-on-failure helm flags#2450
yxxhero wants to merge 2 commits intomainfrom
fix/kubedog-atomic-rollback

Conversation

@yxxhero
Copy link
Copy Markdown
Member

@yxxhero yxxhero commented Mar 3, 2026

Problem

When using atomic: true with trackMode: kubedog, the --atomic flag was passed to Helm which caused Helm to wait for resources and rollback internally before helmfile could start kubedog tracking. This prevented users from seeing deployment logs and errors during failed deployments.

Solution

Modified helmfile to skip passing --atomic to Helm when kubedog is enabled, and instead handle the rollback manually if kubedog tracking fails. This preserves atomic semantics while allowing kubedog to track resources.

Changes

  • Add RollbackRelease method to helmexec.Interface and implementation to support manual rollback
  • Add appendAtomicFlags function that intelligently skips --atomic when kubedog is enabled
  • Add handleKubedogFailure function to execute rollback when kubedog tracking fails and atomic semantics are enabled
  • Update flagsForUpgrade to use new atomic flag handling
  • Add comprehensive tests for the new atomic flag behavior

Behavior

Before:

atomic: true + trackMode: kubedog
→ Helm waits for resources with --atomic
→ Failure occurs → Helm automatically rolls back
→ Returns error to helmfile
→ kubedog never starts ❌

After:

atomic: true + trackMode: kubedog
→ Helm upgrade runs (without --atomic)
→ kubedog starts tracking immediately ✅
→ If tracking fails → helmfile manually rolls back ✅
→ Atomic semantics preserved ✅

Testing

  • Added TestAppendAtomicFlags with 7 test cases
  • All existing tests pass
  • make check passes (lint + vet)

Example

Users can now use this configuration:

helmDefaults:
  atomic: true
  trackMode: kubedog
  wait: true

And see kubedog tracking output even when deployments fail, with automatic rollback still working.

Fixes #2448

@stale
Copy link
Copy Markdown

stale bot commented Mar 18, 2026

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 18, 2026
@yxxhero yxxhero removed the wontfix This will not be worked on label Mar 20, 2026
@yxxhero
Copy link
Copy Markdown
Member Author

yxxhero commented Mar 24, 2026

@copilot fix ci issues.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

@copilot fix ci issues.

Fixed in commit 03fe2ef. The CI failures were two unparam lint errors:

  1. shouldUseAtomic had an unused ops *SyncOpts parameter — removed it and updated callers
  2. handleKubedogFailure had an unused trackErr error parameter — removed it and updated callers (the error was already being logged by the caller before this function was invoked)

yxxhero and others added 2 commits March 25, 2026 08:37
When using atomic: true with trackMode: kubedog, the --atomic flag was
passed to Helm which caused Helm to wait for resources and rollback
internally before helmfile could start kubedog tracking. This prevented
users from seeing deployment logs and errors.

Changes:
- Add RollbackRelease method to helmexec interface and implementation
- Add appendAtomicFlags function that skips --atomic when kubedog is enabled
- Add handleKubedogFailure function to manually rollback on tracking failure
- Update flagsForUpgrade to use new atomic flag handling
- Add tests for appendAtomicFlags behavior

Now when atomic: true and trackMode: kubedog are both enabled:
1. Helm upgrade runs without --atomic (no internal wait)
2. kubedog tracks resources immediately (users can see logs)
3. If kubedog tracking fails, helmfile manually executes rollback
4. Atomic semantics are preserved

Fixes: #2448
Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero yxxhero force-pushed the fix/kubedog-atomic-rollback branch from 03fe2ef to 4343f64 Compare March 25, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kubedog based tracking issue with atomic/rollback-on-failure helm flags

2 participants