From 8291b847d5815d29465081035d66da26a0d1aecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 18 Aug 2023 12:27:54 +0200 Subject: [PATCH 1/2] Allow disabling both webhook ports in cloud-provider --- staging/src/k8s.io/cloud-provider/options/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/cloud-provider/options/options.go b/staging/src/k8s.io/cloud-provider/options/options.go index 37aeb01e1c0..15be5a86c07 100644 --- a/staging/src/k8s.io/cloud-provider/options/options.go +++ b/staging/src/k8s.io/cloud-provider/options/options.go @@ -263,7 +263,7 @@ func (o *CloudControllerManagerOptions) Validate(allControllers []string, disabl if o.WebhookServing != nil { errors = append(errors, o.WebhookServing.Validate()...) - if o.WebhookServing.BindPort == o.SecureServing.BindPort { + if o.WebhookServing.BindPort == o.SecureServing.BindPort && o.WebhookServing.BindPort != 0 { errors = append(errors, fmt.Errorf("--webhook-secure-port cannot be the same value as --secure-port")) } } From 8163d244ede6dd5c3ba2bfda42b0c2fe727d6d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 18 Aug 2023 13:04:12 +0200 Subject: [PATCH 2/2] Update ccm flag help to describe disabling webhook serving No need to mention the default in the message. Defaults are printed by default when they are available. --- staging/src/k8s.io/cloud-provider/options/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/cloud-provider/options/webhook.go b/staging/src/k8s.io/cloud-provider/options/webhook.go index 719a701025a..346e4218d40 100644 --- a/staging/src/k8s.io/cloud-provider/options/webhook.go +++ b/staging/src/k8s.io/cloud-provider/options/webhook.go @@ -122,7 +122,7 @@ func (o *WebhookServingOptions) AddFlags(fs *pflag.FlagSet) { "associated interface(s) must be reachable by the rest of the cluster, and by CLI/web "+ fmt.Sprintf("clients. If set to an unspecified address (0.0.0.0 or ::), all interfaces will be used. If unset, defaults to %v.", o.BindAddress)) - fs.IntVar(&o.BindPort, "webhook-secure-port", o.BindPort, fmt.Sprintf("Secure port to serve cloud provider webhooks. If unset, defaults to %d.", o.BindPort)) + fs.IntVar(&o.BindPort, "webhook-secure-port", o.BindPort, "Secure port to serve cloud provider webhooks. If 0, don't serve webhooks at all.") fs.StringVar(&o.ServerCert.CertDirectory, "webhook-cert-dir", o.ServerCert.CertDirectory, ""+ "The directory where the TLS certs are located. "+