mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #109892 from jlsong01/add_annotation_comments
clarify a comment on annotation key validation
This commit is contained in:
commit
de449881fd
@ -44,6 +44,7 @@ var BannedOwners = map[schema.GroupVersionKind]struct{}{
|
|||||||
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
|
||||||
allErrs := field.ErrorList{}
|
allErrs := field.ErrorList{}
|
||||||
for k := range annotations {
|
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)) {
|
for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath, k, msg))
|
allErrs = append(allErrs, field.Invalid(fldPath, k, msg))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user