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

View File

@@ -126,10 +126,14 @@ func startNodeIpamController(ctx context.Context, controllerContext ControllerCo
return nil, false, nil
}
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 && controllerContext.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) {
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)
if err != nil {