mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
clarify a comment on annotation key validation
Update staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go Co-authored-by: Daniel Smith <dbsmith@google.com>
This commit is contained in:
parent
7af5a7bfc5
commit
d0353e3214
@ -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