rebase: replace MetricsBindAddress with Metrics

MetricsBindAddress is replaced by Metrics in the
controller-runtime manager options in version 0.16.0
as part of
e59161ee8f
Updating the same here.

Signed-off-by: karthik-us <ksubrahm@redhat.com>
This commit is contained in:
karthik-us 2023-08-29 12:31:01 +05:30 committed by mergify[bot]
parent a51516501c
commit 855d09c1cd

View File

@ -24,6 +24,7 @@ import (
clientConfig "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"
)
// Manager is the interface that will wrap Add function.
@ -62,7 +63,7 @@ func Start(config Config) error {
opts := manager.Options{
LeaderElection: true,
// disable metrics
MetricsBindAddress: "0",
Metrics: metricsserver.Options{BindAddress: "0"},
LeaderElectionNamespace: config.Namespace,
LeaderElectionResourceLock: resourcelock.LeasesResourceLock,
LeaderElectionID: electionID,