From b48d68682d3ed5a0b65bb46e8755a15e9766411d Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Tue, 17 Oct 2023 15:32:52 -0700 Subject: [PATCH] :sparkles: Add webhook-cert-dir flag Adds the --webhook-cert-dir flag to customize where the certificates are stored, and passes it to the controller-runtime webhook handler. Signed-off-by: Vince Prignano --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3f79e50bad6..06cf7107fd6 100644 --- a/main.go +++ b/main.go @@ -109,6 +109,7 @@ var ( syncPeriod time.Duration healthAddr string webhookPort int + webhookCertDir string reconcileTimeout time.Duration enableTracing bool ) @@ -221,9 +222,12 @@ func InitFlags(fs *pflag.FlagSet) { fs.IntVar(&webhookPort, "webhook-port", 9443, - "Webhook Server port, disabled by default. When enabled, the manager will only work as webhook server, no reconcilers are installed.", + "The webhook server port the manager will listen on.", ) + fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/", + "The webhook certificate directory, where the server should find the TLS certificate and key.") + fs.DurationVar(&reconcileTimeout, "reconcile-timeout", reconciler.DefaultLoopTimeout, @@ -289,7 +293,8 @@ func main() { }, }, WebhookServer: webhook.NewServer(webhook.Options{ - Port: webhookPort, + Port: webhookPort, + CertDir: webhookCertDir, }), EventBroadcaster: broadcaster, })