Skip to content

Commit

Permalink
updating metrics-require-rbac and metrics-secure validation logic and…
Browse files Browse the repository at this point in the history
… error log

Signed-off-by: Adam D. Cornett <[email protected]>
  • Loading branch information
acornett21 committed Nov 6, 2024
1 parent e8cd0a3 commit 4d9307d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/helm-operator/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func NewCmd() *cobra.Command {
Use: "run",
Short: "Run the operator",
Args: func(cmd *cobra.Command, args []string) error {
if cmd.Flag("metrics-require-rbac").Changed && !cmd.Flag("metrics-secure").Changed {
return fmt.Errorf("--metrics-secure flag is required when --metrics-require-rbac is present")
if cmd.Flag("metrics-require-rbac").Value.String() == "true" && cmd.Flag("metrics-secure").Value.String() == "false" {
return errors.New("--metrics-secure flag is required when --metrics-require-rbac is present")
}
return nil
},
Expand Down

0 comments on commit 4d9307d

Please sign in to comment.