Clarify that value arg to field.TooLong is unused

This commit is contained in:
Tim Hockin
2024-11-04 15:44:40 -08:00
parent 4d0e1c8fd4
commit 8a7af90300
14 changed files with 34 additions and 38 deletions

View File

@@ -526,7 +526,7 @@ func ValidateIngressClassUpdate(newIngressClass, oldIngressClass *networking.Ing
func validateIngressClassSpec(spec *networking.IngressClassSpec, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if len(spec.Controller) > maxLenIngressClassController {
allErrs = append(allErrs, field.TooLong(fldPath.Child("controller"), spec.Controller, maxLenIngressClassController))
allErrs = append(allErrs, field.TooLong(fldPath.Child("controller"), "", maxLenIngressClassController))
}
allErrs = append(allErrs, validation.IsDomainPrefixedPath(fldPath.Child("controller"), spec.Controller)...)
allErrs = append(allErrs, validateIngressClassParametersReference(spec.Parameters, fldPath.Child("parameters"))...)