Skip to content

Commit

Permalink
Tidy: Unhide allow-empty-selectors flag and hint to it in the error m…
Browse files Browse the repository at this point in the history
…essage
  • Loading branch information
rspurgeon committed Jan 24, 2024
1 parent 2f407a2 commit cfd70e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/file_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func executeNamespace(cmd *cobra.Command, _ []string) error {

err = namespace.Apply(yamlNode, selectors, cmdNamespacePathPrefix, cmdNamespaceAllowEmptySelectors)
if err != nil {
return fmt.Errorf("failed to apply the namespace: %w", err)
return fmt.Errorf("failed to apply the namespace: %w. Use --allow-empty-selectors to suppress this error.", err)

Check warning on line 62 in cmd/file_namespace.go

View workflow job for this annotation

GitHub Actions / test

error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
}

data = jsonbasics.ConvertToJSONobject(yamlNode)
Expand Down Expand Up @@ -141,7 +141,6 @@ routes:
"The path based namespace to apply.")
namespaceCmd.Flags().BoolVarP(&cmdNamespaceAllowEmptySelectors, "allow-empty-selectors",
"", false, "do not error out if the selectors return empty")
namespaceCmd.Flags().Lookup("allow-empty-selectors").Hidden = true

return namespaceCmd
}

0 comments on commit cfd70e8

Please sign in to comment.