Skip to content

Commit

Permalink
✨ Add webhook-cert-dir flag
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vincepri committed Oct 18, 2023
1 parent b4221b5 commit b48d686
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ var (
syncPeriod time.Duration
healthAddr string
webhookPort int
webhookCertDir string
reconcileTimeout time.Duration
enableTracing bool
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -289,7 +293,8 @@ func main() {
},
},
WebhookServer: webhook.NewServer(webhook.Options{
Port: webhookPort,
Port: webhookPort,
CertDir: webhookCertDir,
}),
EventBroadcaster: broadcaster,
})
Expand Down

0 comments on commit b48d686

Please sign in to comment.