Merge pull request #74045 from xichengliudui/fixgolint

Fix golint failures on cmd/apis/extensions/...
This commit is contained in:
Kubernetes Prow Robot
2019-02-19 09:55:44 -08:00
committed by GitHub
2 changed files with 3 additions and 5 deletions

View File

@@ -52,7 +52,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