Merge pull request #123011 from dims/add-deprecation-notice-for-cloud-allocator-in-node-ipam-controller

Add DEPRECATION for CloudAllocator in node-ipam-controller
This commit is contained in:
Kubernetes Prow Robot 2024-01-29 16:23:47 -08:00 committed by GitHub
commit 65e77e7775
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,9 +126,13 @@ 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")
if controllerContext.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) {
// Cannot run cloud ipam controller if cloud provider is nil (--cloud-provider not set or set to 'external')
if controllerContext.Cloud == nil {
return nil, false, errors.New("--cidr-allocator-type is set to 'CloudAllocator' but cloud provider is not configured")
}
// As part of the removal of all the cloud providers from kubernetes, this support will be removed as well
klog.Warningf("DEPRECATED: 'CloudAllocator' bas been deprecated and will be removed in a future release.")
}
clusterCIDRs, err := validateCIDRs(controllerContext.ComponentConfig.KubeCloudShared.ClusterCIDR)