Merge pull request #120044 from apricote/cp-port-0

Allow disabling both listened-on ports in cloud-provider
This commit is contained in:
Kubernetes Prow Robot
2023-08-31 22:02:31 -07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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"))
}
}

View File

@@ -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. "+