Exclude service itself when checking conflict.
This commit is contained in:
@@ -431,7 +431,9 @@ func ValidateService(service *api.Service, lister ServiceLister, ctx api.Context
|
||||
allErrs = append(allErrs, errs.NewInternalError(err))
|
||||
} else {
|
||||
for i := range services.Items {
|
||||
if services.Items[i].Spec.CreateExternalLoadBalancer && services.Items[i].Spec.Port == service.Spec.Port {
|
||||
if services.Items[i].Name != service.Name &&
|
||||
services.Items[i].Spec.CreateExternalLoadBalancer &&
|
||||
services.Items[i].Spec.Port == service.Spec.Port {
|
||||
allErrs = append(allErrs, errs.NewConflict("service", service.Name, fmt.Errorf("Port: %d is already in use", service.Spec.Port)))
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user