mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	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