mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #99578 from pandaamanda/remove_duplicate_apiserverServiceRange_validation
remove duplicated validation for service-cluster-ip-range
This commit is contained in:
commit
5c5aa98215
@ -71,6 +71,8 @@ type ServerRunOptions struct {
|
||||
// of parsing ServiceClusterIPRange into actual values
|
||||
PrimaryServiceClusterIPRange net.IPNet
|
||||
SecondaryServiceClusterIPRange net.IPNet
|
||||
// APIServerServiceIP is the first valid IP from PrimaryServiceClusterIPRange
|
||||
APIServerServiceIP net.IP
|
||||
|
||||
ServiceNodePortRange utilnet.PortRange
|
||||
SSHKeyfile string
|
||||
|
@ -330,21 +330,6 @@ func CreateKubeAPIServerConfig(
|
||||
|
||||
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{
|
||||
GenericConfig: genericConfig,
|
||||
ExtraConfig: controlplane.ExtraConfig{
|
||||
@ -357,9 +342,9 @@ func CreateKubeAPIServerConfig(
|
||||
|
||||
Tunneler: nodeTunneler,
|
||||
|
||||
ServiceIPRange: serviceIPRange,
|
||||
APIServerServiceIP: apiServerServiceIP,
|
||||
SecondaryServiceIPRange: secondaryServiceIPRange,
|
||||
ServiceIPRange: s.PrimaryServiceClusterIPRange,
|
||||
APIServerServiceIP: s.APIServerServiceIP,
|
||||
SecondaryServiceIPRange: s.SecondaryServiceClusterIPRange,
|
||||
|
||||
APIServerServicePort: 443,
|
||||
|
||||
@ -611,6 +596,7 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) {
|
||||
}
|
||||
s.PrimaryServiceClusterIPRange = primaryServiceIPRange
|
||||
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 {
|
||||
return options, fmt.Errorf("error creating self-signed certificates: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user