File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ func InitFlags(fs *pflag.FlagSet) {
143
143
"The minimum interval at which watched resources are reconciled (e.g. 15m)" )
144
144
145
145
fs .IntVar (& webhookPort , "webhook-port" , 9443 ,
146
- "Webhook Server port" )
146
+ "Webhook Server port. Set 0 to disable it. " )
147
147
148
148
fs .StringVar (& webhookCertDir , "webhook-cert-dir" , "/tmp/k8s-webhook-server/serving-certs/" ,
149
149
"Webhook cert dir, only used when webhook-port is specified." )
@@ -311,6 +311,10 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
311
311
}
312
312
313
313
func setupWebhooks (mgr ctrl.Manager ) {
314
+ if webhookPort == 0 {
315
+ return
316
+ }
317
+
314
318
if err := (& clusterv1.Cluster {}).SetupWebhookWithManager (mgr ); err != nil {
315
319
setupLog .Error (err , "unable to create webhook" , "webhook" , "Cluster" )
316
320
os .Exit (1 )
You can’t perform that action at this time.
0 commit comments