rebase: update K8s packages to v0.32.1

Update K8s packages in go.mod to v0.32.1

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2025-01-16 09:41:46 +05:30
committed by mergify[bot]
parent 5aef21ea4e
commit 7eb99fc6c9
2442 changed files with 273386 additions and 47788 deletions

View File

@ -61,8 +61,8 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
fs.DurationVar(&o.NodeMonitorPeriod.Duration, "node-monitor-period", o.NodeMonitorPeriod.Duration,
fmt.Sprintf("The period for syncing NodeStatus in %s.", names.CloudNodeLifecycleController))
fs.StringVar(&o.ClusterName, "cluster-name", o.ClusterName, "The instance prefix for the cluster.")
fs.StringVar(&o.ClusterCIDR, "cluster-cidr", o.ClusterCIDR, "CIDR Range for Pods in cluster. Requires --allocate-node-cidrs to be true")
fs.BoolVar(&o.AllocateNodeCIDRs, "allocate-node-cidrs", false, "Should CIDRs for Pods be allocated and set on the cloud provider.")
fs.StringVar(&o.ClusterCIDR, "cluster-cidr", o.ClusterCIDR, "CIDR Range for Pods in cluster. Only used when --allocate-node-cidrs=true; if false, this option will be ignored.")
fs.BoolVar(&o.AllocateNodeCIDRs, "allocate-node-cidrs", false, "Should CIDRs for Pods be allocated and set on the cloud provider. Requires --cluster-cidr.")
fs.StringVar(&o.CIDRAllocatorType, "cidr-allocator-type", "RangeAllocator", "Type of CIDR allocator to use")
fs.BoolVar(&o.ConfigureCloudRoutes, "configure-cloud-routes", true, "Should CIDRs allocated by allocate-node-cidrs be configured on the cloud provider.")

View File

@ -201,7 +201,7 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *config.Config, allControllers
}
}
if o.WebhookServing != nil {
if err = o.WebhookServing.ApplyTo(&c.WebhookSecureServing); err != nil {
if err = o.WebhookServing.ApplyTo(&c.WebhookSecureServing, c.ComponentConfig.Webhook); err != nil {
return err
}
}

View File

@ -151,7 +151,7 @@ func (o *WebhookServingOptions) Validate() []error {
return allErrors
}
func (o *WebhookServingOptions) ApplyTo(cfg **server.SecureServingInfo) error {
func (o *WebhookServingOptions) ApplyTo(cfg **server.SecureServingInfo, webhookCfg config.WebhookConfiguration) error {
if o == nil {
return nil
}
@ -159,6 +159,10 @@ func (o *WebhookServingOptions) ApplyTo(cfg **server.SecureServingInfo) error {
if o.BindPort <= 0 {
return nil
}
// no need to bind to the address if there are no webhook enabled.
if len(webhookCfg.Webhooks) == 0 {
return nil
}
var err error
var listener net.Listener

View File

@ -33,15 +33,8 @@ type Factory func(config io.Reader) (Interface, error)
// All registered cloud providers.
var (
providersMutex sync.Mutex
providers = make(map[string]Factory)
deprecatedCloudProviders = []struct {
name string
external bool
detail string
}{
{"gce", false, "The GCE provider is deprecated and will be removed in a future release. Please use https://github.com/kubernetes/cloud-provider-gcp"},
}
providersMutex sync.Mutex
providers = make(map[string]Factory)
)
const externalCloudProvider = "external"
@ -87,47 +80,19 @@ func IsExternal(name string) bool {
return name == externalCloudProvider
}
// IsDeprecatedInternal is responsible for preventing cloud.Interface
// from being initialized in kubelet, kube-controller-manager or kube-api-server
func IsDeprecatedInternal(name string) bool {
for _, provider := range deprecatedCloudProviders {
if provider.name == name {
return true
}
}
return false
}
// DisableWarningForProvider logs information about disabled cloud provider state
func DisableWarningForProvider(providerName string) {
for _, provider := range deprecatedCloudProviders {
if provider.name == providerName {
klog.Infof("INFO: Please make sure you are running external cloud controller manager binary for provider %q."+
"In-tree cloud providers are currently disabled. Refer to https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/cloud-provider/sample"+
"for example implementation.", providerName)
detail := fmt.Sprintf("Please reach to sig-cloud-provider and use 'external' cloud provider for %q: %s", providerName, provider.detail)
klog.Warningf("WARNING: %q built-in cloud provider is now disabled. %s", providerName, detail)
break
}
if !IsExternal(providerName) {
klog.Infof("INFO: Please make sure you are running an external cloud controller manager binary for provider %q."+
"In-tree cloud providers are disabled. Refer to https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/cloud-provider/sample "+
"for an example implementation.", providerName)
klog.Warningf("WARNING: built-in cloud providers are disabled. Please set \"--cloud-provider=external\" and migrate to an external cloud controller manager for provider %q", providerName)
}
}
// DeprecationWarningForProvider logs information about deprecated cloud provider state
func DeprecationWarningForProvider(providerName string) {
for _, provider := range deprecatedCloudProviders {
if provider.name != providerName {
continue
}
detail := provider.detail
if provider.external {
detail = fmt.Sprintf("Please use 'external' cloud provider for %s: %s", providerName, provider.detail)
}
klog.Warningf("WARNING: %s built-in cloud provider is now deprecated. %s", providerName, detail)
break
}
// ErrorForDisabledProvider returns an error formatted with the supplied provider name
func ErrorForDisabledProvider(providerName string) error {
return fmt.Errorf("cloud provider %q was specified, but built-in cloud providers are disabled. Please set --cloud-provider=external and migrate to an external cloud provider", providerName)
}
// InitCloudProvider creates an instance of the named cloud provider.