Skip to content

Commit

Permalink
Merge pull request #1970 from Adirio/validate-plural
Browse files Browse the repository at this point in the history
🐛 Validate the plugin flag
  • Loading branch information
k8s-ci-robot committed Jan 25, 2021
2 parents b290147 + 45f69ce commit 7b84f60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/plugins/golang/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ func (opts Options) Validate() error {
return fmt.Errorf("invalid Kind: %#v", validationErrors)
}

// TODO: validate plural strings if provided
if opts.Plural != "" {
validationErrors = append(validationErrors, validation.IsDNS1035Label(opts.Plural)...)

if len(validationErrors) != 0 {
return fmt.Errorf("invalid Plural: %#v", validationErrors)
}
}

// Ensure apiVersions for k8s types are empty or valid.
for typ, apiVersion := range map[string]string{
Expand Down

0 comments on commit 7b84f60

Please sign in to comment.