From 41dce60b04eec957180bdbe838090b67f05a3180 Mon Sep 17 00:00:00 2001 From: Leah Leshchinsky Date: Mon, 18 Dec 2023 12:09:03 -0500 Subject: [PATCH] controller-runtime v0.16.2 updates Fix breaking changes from upgrade of controller-runtime. Breaking changes from: https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.16.0 - https://github.com/kubernetes-sigs/controller-runtime/pull/2407 - https://github.com/kubernetes-sigs/controller-runtime/pull/2416 HIVE-2254 Signed-off-by: Leah Leshchinsky --- cmd/manager/main.go | 7 ++++--- cmd/operator/main.go | 7 ++++--- test/e2e/common/machine.go | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 85950a7a77f..61f9e237ef6 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -21,6 +21,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/manager/signals" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" _ "github.com/openshift/generic-admission-server/pkg/cmd" @@ -155,9 +156,9 @@ func newRootCommand() *cobra.Command { run := func(ctx context.Context) { // Create a new Cmd to provide shared dependencies and start components mgr, err := manager.New(cfg, manager.Options{ - Scheme: scheme.GetScheme(), - MetricsBindAddress: ":2112", - Logger: utillogrus.NewLogr(log.StandardLogger()), + Scheme: scheme.GetScheme(), + Metrics: metricsserver.Options{BindAddress: ":2112"}, + Logger: utillogrus.NewLogr(log.StandardLogger()), }) if err != nil { log.Fatal(err) diff --git a/cmd/operator/main.go b/cmd/operator/main.go index af44e93ddc2..e3735bf001a 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -18,6 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/manager/signals" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" _ "github.com/openshift/generic-admission-server/pkg/cmd" @@ -83,9 +84,9 @@ func newRootCommand() *cobra.Command { run := func(ctx context.Context) { // Create a new Cmd to provide shared dependencies and start components mgr, err := manager.New(cfg, manager.Options{ - Scheme: scheme.GetScheme(), - MetricsBindAddress: ":2112", - Logger: utillogrus.NewLogr(log.StandardLogger()), + Scheme: scheme.GetScheme(), + Metrics: metricsserver.Options{BindAddress: ":2112"}, + Logger: utillogrus.NewLogr(log.StandardLogger()), }) if err != nil { log.Fatal(err) diff --git a/test/e2e/common/machine.go b/test/e2e/common/machine.go index 4cba60da747..b6365c81c4f 100644 --- a/test/e2e/common/machine.go +++ b/test/e2e/common/machine.go @@ -23,8 +23,8 @@ func WaitForMachines(cfg *rest.Config, testFunc func([]*machinev1.Machine) bool, scheme := scheme.GetScheme() internalCache, err := cache.New(cfg, cache.Options{ - Namespaces: []string{"openshift-machine-api"}, - Scheme: scheme, + DefaultNamespaces: map[string]cache.Config{"openshift-machine-api": {}}, + Scheme: scheme, }) if err != nil { return err