From 56b497431031502476505302406fcd2274968a51 Mon Sep 17 00:00:00 2001 From: Jacob Salway Date: Sun, 29 Sep 2024 17:07:37 +1000 Subject: [PATCH] Fix ingress capability discovery (#2201) Signed-off-by: Jacob Salway --- cmd/operator/controller/start.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/operator/controller/start.go b/cmd/operator/controller/start.go index f34be8c8d..031ca8f9b 100644 --- a/cmd/operator/controller/start.go +++ b/cmd/operator/controller/start.go @@ -25,17 +25,18 @@ import ( // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. - "golang.org/x/time/rate" _ "k8s.io/client-go/plugin/pkg/client/auth" "github.com/spf13/cobra" "github.com/spf13/viper" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "golang.org/x/time/rate" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/client-go/kubernetes" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/clock" ctrl "sigs.k8s.io/controller-runtime" @@ -228,6 +229,17 @@ func start() { os.Exit(1) } + clientset, err := kubernetes.NewForConfig(cfg) + if err != nil { + logger.Error(err, "failed to create clientset") + os.Exit(1) + } + + if err = util.InitializeIngressCapabilities(clientset); err != nil { + logger.Error(err, "failed to retrieve cluster ingress capabilities") + os.Exit(1) + } + var registry *scheduler.Registry if enableBatchScheduler { registry = scheduler.GetRegistry()