From 52085156047292ae035b1cd1451ece68d24d070c Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 23 Dec 2024 17:44:33 +0200 Subject: [PATCH] Make `flux debug hr` single flag selection required Signed-off-by: Stefan Prodan --- cmd/flux/debug_helmrelease.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/flux/debug_helmrelease.go b/cmd/flux/debug_helmrelease.go index 0bde73bc..d87d8155 100644 --- a/cmd/flux/debug_helmrelease.go +++ b/cmd/flux/debug_helmrelease.go @@ -63,7 +63,8 @@ func init() { func debugHelmReleaseCmdRun(cmd *cobra.Command, args []string) error { name := args[0] - if debugHelmReleaseArgs.showStatus == false && debugHelmReleaseArgs.showValues == false { + if (!debugHelmReleaseArgs.showStatus && !debugHelmReleaseArgs.showValues) || + (debugHelmReleaseArgs.showStatus && debugHelmReleaseArgs.showValues) { return fmt.Errorf("either --show-status or --show-values must be set") } @@ -88,9 +89,7 @@ func debugHelmReleaseCmdRun(cmd *cobra.Command, args []string) error { } rootCmd.Println("# Status documentation: https://fluxcd.io/flux/components/helm/helmreleases/#helmrelease-status") rootCmd.Print(string(status)) - if debugHelmReleaseArgs.showValues { - rootCmd.Println("---") - } + return nil } if debugHelmReleaseArgs.showValues {