Fix golint failures on cmd/apis/extensions/...

pull/564/head
xichengliudui 2019-02-12 12:39:48 -05:00
parent 508a4f7544
commit a89ee493dd
2 changed files with 3 additions and 5 deletions

View File

@ -53,7 +53,6 @@ pkg/apis/events
pkg/apis/events/v1beta1
pkg/apis/extensions
pkg/apis/extensions/v1beta1
pkg/apis/extensions/validation
pkg/apis/imagepolicy
pkg/apis/imagepolicy/v1alpha1
pkg/apis/networking

View File

@ -162,10 +162,9 @@ func validateIngressBackend(backend *extensions.IngressBackend, fldPath *field.P
// All backends must reference a single local service by name, and a single service port by name or number.
if len(backend.ServiceName) == 0 {
return append(allErrs, field.Required(fldPath.Child("serviceName"), ""))
} else {
for _, msg := range apivalidation.ValidateServiceName(backend.ServiceName, false) {
allErrs = append(allErrs, field.Invalid(fldPath.Child("serviceName"), backend.ServiceName, msg))
}
}
for _, msg := range apivalidation.ValidateServiceName(backend.ServiceName, false) {
allErrs = append(allErrs, field.Invalid(fldPath.Child("serviceName"), backend.ServiceName, msg))
}
allErrs = append(allErrs, apivalidation.ValidatePortNumOrName(backend.ServicePort, fldPath.Child("servicePort"))...)
return allErrs