Merge pull request #109892 from jlsong01/add_annotation_comments

clarify a comment on annotation key validation
This commit is contained in:
Kubernetes Prow Robot 2022-05-27 11:36:41 -07:00 committed by GitHub
commit de449881fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))
}