From ed4ad50b226987bc584ac47579f67ccf136b3f59 Mon Sep 17 00:00:00 2001 From: Jake Sanders Date: Thu, 5 Aug 2021 15:22:02 +0100 Subject: [PATCH] Don't start the Gateway Shared Informer Factory if the Gateway API feature is disabled Signed-off-by: Jake Sanders --- cmd/controller/app/controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/controller/app/controller.go b/cmd/controller/app/controller.go index 6dc31badb..4b1d97205 100644 --- a/cmd/controller/app/controller.go +++ b/cmd/controller/app/controller.go @@ -194,7 +194,10 @@ func Run(opts *options.ControllerOptions, stopCh <-chan struct{}) error { log.V(logf.DebugLevel).Info("starting shared informer factories") ctx.SharedInformerFactory.Start(rootCtx.Done()) ctx.KubeSharedInformerFactory.Start(rootCtx.Done()) - ctx.GWShared.Start(rootCtx.Done()) + + if utilfeature.DefaultFeatureGate.Enabled(feature.ExperimentalGatewayAPISupport) { + ctx.GWShared.Start(rootCtx.Done()) + } err = g.Wait() if err != nil {