You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add --kube-context flag support
Add native --kube-context flag to all helm-diff commands (upgrade, revision,
rollback, release) to allow users to specify kubeconfig context directly
instead of relying on HELM_KUBECONTEXT environment variable workaround.
Fixes#603
Signed-off-by: yxxhero <aiopsclub@163.com>
* test: add kube-context flag tests
Add tests to verify that --kube-context flag is properly passed to
helm commands, addressing review comments from PR #924:
- Test basic --kube-context flag propagation to helm commands
- Test --kube-context with --reuse-values flag
- Test that --namespace is also passed when using --kube-context
- Add wildcard argument matching for dynamic temp file paths
Signed-off-by: yxxhero <aiopsclub@163.com>
* test: add kube-context flag tests for revision, rollback and release commands
Signed-off-by: yxxhero <aiopsclub@163.com>
* fix: address PR review comments
- Use local copy of envSettings in actionConfig.Init to avoid mutating
shared state and prevent data races
- Fix test stub flag order to match production code (--namespace before
--kube-context)
- Extract helmDiffTestHelper to reduce duplicated test setup code
Signed-off-by: yxxhero <aiopsclub@163.com>
---------
Signed-off-by: yxxhero <aiopsclub@163.com>
releaseCmd.Flags().BoolVar(&diff.detailedExitCode, "detailed-exitcode", false, "return a non-zero exit code when there are changes")
64
65
releaseCmd.Flags().BoolVar(&diff.includeTests, "include-tests", false, "enable the diffing of the helm test hooks")
65
66
releaseCmd.Flags().BoolVar(&diff.normalizeManifests, "normalize-manifests", false, "normalize manifests before running diff to exclude style differences from the output")
67
+
releaseCmd.Flags().StringVar(&diff.kubeContext, "kube-context", "", "name of the kubeconfig context to use")
revisionCmd.Flags().BoolVar(&diff.detailedExitCode, "detailed-exitcode", false, "return a non-zero exit code when there are changes")
71
72
revisionCmd.Flags().BoolVar(&diff.includeTests, "include-tests", false, "enable the diffing of the helm test hooks")
72
73
revisionCmd.Flags().BoolVar(&diff.normalizeManifests, "normalize-manifests", false, "normalize manifests before running diff to exclude style differences from the output")
74
+
revisionCmd.Flags().StringVar(&diff.kubeContext, "kube-context", "", "name of the kubeconfig context to use")
rollbackCmd.Flags().BoolVar(&diff.detailedExitCode, "detailed-exitcode", false, "return a non-zero exit code when there are changes")
61
62
rollbackCmd.Flags().BoolVar(&diff.includeTests, "include-tests", false, "enable the diffing of the helm test hooks")
62
63
rollbackCmd.Flags().BoolVar(&diff.normalizeManifests, "normalize-manifests", false, "normalize manifests before running diff to exclude style differences from the output")
64
+
rollbackCmd.Flags().StringVar(&diff.kubeContext, "kube-context", "", "name of the kubeconfig context to use")
0 commit comments