mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	remove duplicated validation for service-cluster-ip-range
This commit is contained in:
		
				
					committed by
					
						
						pandaamanda
					
				
			
			
				
	
			
			
			
						parent
						
							793390e13b
						
					
				
				
					commit
					e6d6409cf8
				
			@@ -71,6 +71,8 @@ type ServerRunOptions struct {
 | 
				
			|||||||
	// of parsing ServiceClusterIPRange into actual values
 | 
						// of parsing ServiceClusterIPRange into actual values
 | 
				
			||||||
	PrimaryServiceClusterIPRange   net.IPNet
 | 
						PrimaryServiceClusterIPRange   net.IPNet
 | 
				
			||||||
	SecondaryServiceClusterIPRange net.IPNet
 | 
						SecondaryServiceClusterIPRange net.IPNet
 | 
				
			||||||
 | 
						// APIServerServiceIP is the first valid IP from PrimaryServiceClusterIPRange
 | 
				
			||||||
 | 
						APIServerServiceIP net.IP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ServiceNodePortRange utilnet.PortRange
 | 
						ServiceNodePortRange utilnet.PortRange
 | 
				
			||||||
	SSHKeyfile           string
 | 
						SSHKeyfile           string
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -330,21 +330,6 @@ func CreateKubeAPIServerConfig(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	s.Logs.Apply()
 | 
						s.Logs.Apply()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	serviceIPRange, apiServerServiceIP, err := controlplane.ServiceIPRange(s.PrimaryServiceClusterIPRange)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		return nil, nil, nil, err
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// defaults to empty range and ip
 | 
					 | 
				
			||||||
	var secondaryServiceIPRange net.IPNet
 | 
					 | 
				
			||||||
	// process secondary range only if provided by user
 | 
					 | 
				
			||||||
	if s.SecondaryServiceClusterIPRange.IP != nil {
 | 
					 | 
				
			||||||
		secondaryServiceIPRange, _, err = controlplane.ServiceIPRange(s.SecondaryServiceClusterIPRange)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			return nil, nil, nil, err
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	config := &controlplane.Config{
 | 
						config := &controlplane.Config{
 | 
				
			||||||
		GenericConfig: genericConfig,
 | 
							GenericConfig: genericConfig,
 | 
				
			||||||
		ExtraConfig: controlplane.ExtraConfig{
 | 
							ExtraConfig: controlplane.ExtraConfig{
 | 
				
			||||||
@@ -357,9 +342,9 @@ func CreateKubeAPIServerConfig(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			Tunneler: nodeTunneler,
 | 
								Tunneler: nodeTunneler,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ServiceIPRange:          serviceIPRange,
 | 
								ServiceIPRange:          s.PrimaryServiceClusterIPRange,
 | 
				
			||||||
			APIServerServiceIP:      apiServerServiceIP,
 | 
								APIServerServiceIP:      s.APIServerServiceIP,
 | 
				
			||||||
			SecondaryServiceIPRange: secondaryServiceIPRange,
 | 
								SecondaryServiceIPRange: s.SecondaryServiceClusterIPRange,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			APIServerServicePort: 443,
 | 
								APIServerServicePort: 443,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -611,6 +596,7 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	s.PrimaryServiceClusterIPRange = primaryServiceIPRange
 | 
						s.PrimaryServiceClusterIPRange = primaryServiceIPRange
 | 
				
			||||||
	s.SecondaryServiceClusterIPRange = secondaryServiceIPRange
 | 
						s.SecondaryServiceClusterIPRange = secondaryServiceIPRange
 | 
				
			||||||
 | 
						s.APIServerServiceIP = apiServerServiceIP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := s.SecureServing.MaybeDefaultWithSelfSignedCerts(s.GenericServerRunOptions.AdvertiseAddress.String(), []string{"kubernetes.default.svc", "kubernetes.default", "kubernetes"}, []net.IP{apiServerServiceIP}); err != nil {
 | 
						if err := s.SecureServing.MaybeDefaultWithSelfSignedCerts(s.GenericServerRunOptions.AdvertiseAddress.String(), []string{"kubernetes.default.svc", "kubernetes.default", "kubernetes"}, []net.IP{apiServerServiceIP}); err != nil {
 | 
				
			||||||
		return options, fmt.Errorf("error creating self-signed certificates: %v", err)
 | 
							return options, fmt.Errorf("error creating self-signed certificates: %v", err)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user