Skip to content

Commit

Permalink
Make flux debug hr single flag selection required
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Dec 23, 2024
1 parent 928ea24 commit 5208515
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/flux/debug_helmrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand All @@ -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 {
Expand Down

0 comments on commit 5208515

Please sign in to comment.