update description

This commit is contained in:
kidddddddddddddddddddddd
2023-03-14 09:42:41 +08:00
parent 113355a5a2
commit 488d7650f4
4 changed files with 8 additions and 12 deletions

View File

@@ -278,7 +278,7 @@ func ValidateIngressCreate(ingress *networking.Ingress) field.ErrorList {
annotationVal, annotationIsSet := ingress.Annotations[annotationIngressClass]
if annotationIsSet && ingress.Spec.IngressClassName != nil && annotationVal != *ingress.Spec.IngressClassName {
annotationPath := field.NewPath("annotations").Child(annotationIngressClass)
allErrs = append(allErrs, field.Invalid(annotationPath, annotationVal, "ingressClass annotation and IngressClassName should have the same value"))
allErrs = append(allErrs, field.Invalid(annotationPath, annotationVal, "must match `ingressClassName` when both are specified"))
}
return allErrs
}

View File

@@ -1005,7 +1005,7 @@ func TestValidateIngressCreate(t *testing.T) {
ingress.Spec.IngressClassName = utilpointer.String("bar")
ingress.Annotations = map[string]string{annotationIngressClass: "foo"}
},
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("annotations").Child(annotationIngressClass), "foo", "ingressClass annotation and IngressClassName should have the same value")},
expectedErrs: field.ErrorList{field.Invalid(field.NewPath("annotations").Child(annotationIngressClass), "foo", "must match `ingressClassName` when both are specified")},
},
"valid regex path": {
tweakIngress: func(ingress *networking.Ingress) {