Skip to content

Commit

Permalink
Merge pull request kubernetes#109892 from jlsong01/add_annotation_com…
Browse files Browse the repository at this point in the history
…ments

clarify a comment on annotation key validation
  • Loading branch information
k8s-ci-robot committed May 27, 2022
2 parents 6c2265c + d0353e3 commit de44988
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var BannedOwners = map[schema.GroupVersionKind]struct{}{
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
for k := range annotations {
// The rule is QualifiedName except that case doesn't matter, so convert to lowercase before checking.
for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) {
allErrs = append(allErrs, field.Invalid(fldPath, k, msg))
}
Expand Down

0 comments on commit de44988

Please sign in to comment.