fix: enable kubedog tracking with atomic/rollback-on-failure helm flags#2450
Open
fix: enable kubedog tracking with atomic/rollback-on-failure helm flags#2450
Conversation
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>
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.
Problem
When using
atomic: truewithtrackMode: kubedog, the--atomicflag 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
--atomicto 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
RollbackReleasemethod tohelmexec.Interfaceand implementation to support manual rollbackappendAtomicFlagsfunction that intelligently skips--atomicwhen kubedog is enabledhandleKubedogFailurefunction to execute rollback when kubedog tracking fails and atomic semantics are enabledflagsForUpgradeto use new atomic flag handlingBehavior
Before:
After:
Testing
TestAppendAtomicFlagswith 7 test casesmake checkpasses (lint + vet)Example
Users can now use this configuration:
And see kubedog tracking output even when deployments fail, with automatic rollback still working.
Fixes #2448