mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Headless services should not need to declare ports
This commit is contained in:
		@@ -1224,7 +1224,7 @@ func ValidateService(service *api.Service) errs.ValidationErrorList {
 | 
			
		||||
	allErrs := errs.ValidationErrorList{}
 | 
			
		||||
	allErrs = append(allErrs, ValidateObjectMeta(&service.ObjectMeta, true, ValidateServiceName).Prefix("metadata")...)
 | 
			
		||||
 | 
			
		||||
	if len(service.Spec.Ports) == 0 {
 | 
			
		||||
	if len(service.Spec.Ports) == 0 && service.Spec.ClusterIP != api.ClusterIPNone {
 | 
			
		||||
		allErrs = append(allErrs, errs.NewFieldRequired("spec.ports"))
 | 
			
		||||
	}
 | 
			
		||||
	if service.Spec.Type == api.ServiceTypeLoadBalancer {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user