Skip to content

Commit

Permalink
chore: improve the InvalidCRDName error message (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlkfi authored Jan 9, 2025
1 parent fa000ae commit 192dc47
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ var invalidCRDNameErrorBuilder = status.NewErrorBuilder(InvalidCRDNameErrorCode)
// InvalidCRDNameError reports a CRD with an invalid name in the repo.
func InvalidCRDNameError(resource client.Object, expected string) status.Error {
return invalidCRDNameErrorBuilder.
Sprintf("The CustomResourceDefinition `metadata.name` MUST be in the form: `<spec.names.plural>.<spec.group>`. "+
"To fix, update those fields or change `metadata.name` to %q.",
expected).
Sprintf("Invalid CustomResourceDefinition name: `%s`."+
" The `metadata.name` MUST be in the form: `<spec.names.plural>.<spec.group>`. "+
"To fix, update the spec fields or change the name to `%s`.",
resource.GetName(), expected).
BuildWithResources(resource)
}

Expand Down

0 comments on commit 192dc47

Please sign in to comment.