mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Merge pull request #114596 from andrewsykim/cloud-node-ipam
Don't run cloud IPAM controller when cloud provider is not enabled
This commit is contained in:
commit
6e65c98681
@ -75,6 +75,11 @@ func startNodeIpamController(initContext app.ControllerInitContext, ccmConfig *c
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
// Cannot run cloud ipam controller if cloud provider is nil (--cloud-provider not set or set to 'external')
|
||||
if cloud == nil && ccmConfig.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) {
|
||||
return nil, false, errors.New("--cidr-allocator-type is set to 'CloudAllocator' but cloud provider is not configured")
|
||||
}
|
||||
|
||||
// failure: bad cidrs in config
|
||||
clusterCIDRs, dualStack, err := processCIDRs(ccmConfig.ComponentConfig.KubeCloudShared.ClusterCIDR)
|
||||
if err != nil {
|
||||
|
@ -105,6 +105,11 @@ func startNodeIpamController(ctx context.Context, controllerContext ControllerCo
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
// Cannot run cloud ipam controller if cloud provider is nil (--cloud-provider not set or set to 'external')
|
||||
if controllerContext.Cloud == nil && controllerContext.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) {
|
||||
return nil, false, errors.New("--cidr-allocator-type is set to 'CloudAllocator' but cloud provider is not configured")
|
||||
}
|
||||
|
||||
clusterCIDRs, err := validateCIDRs(controllerContext.ComponentConfig.KubeCloudShared.ClusterCIDR)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
|
Loading…
Reference in New Issue
Block a user