Skip to content

Commit 7303df0

Browse files
author
jennybuckley
committed
fix nit
1 parent df329d8 commit 7303df0

File tree

1 file changed

+2
-2
lines changed
  • staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation

1 file changed

+2
-2
lines changed

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,10 @@ func ValidateCustomResourceDefinitionOpenAPISchema(schema *apiextensions.JSONSch
800800
allErrs = append(allErrs, field.NotSupported(fldPath.Child("x-kubernetes-list-type"), *schema.XListType, []string{"atomic", "set", "map"}))
801801
}
802802

803-
if len(schema.XListMapKeys) > 0 && (schema.XListType == nil || *schema.XListType != "map") {
803+
if len(schema.XListMapKeys) > 0 {
804804
if schema.XListType == nil {
805805
allErrs = append(allErrs, field.Required(fldPath.Child("x-kubernetes-list-type"), "must be map if x-kubernetes-list-map-keys is non-empty"))
806-
} else {
806+
} else if *schema.XListType != "map" {
807807
allErrs = append(allErrs, field.Invalid(fldPath.Child("x-kubernetes-list-type"), *schema.XListType, "must be map if x-kubernetes-list-map-keys is non-empty"))
808808
}
809809
}

0 commit comments

Comments
 (0)