Skip to content

Commit

Permalink
Fix Manager configuration after controller-runtime update
Browse files Browse the repository at this point in the history
Signed-off-by: Carlo Lobrano <[email protected]>
  • Loading branch information
clobrano committed Oct 20, 2023
1 parent a12322d commit 0b67dbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

"github.com/medik8s/fence-agents-remediation/api/v1alpha1"
"github.com/medik8s/fence-agents-remediation/controllers"
Expand Down Expand Up @@ -75,10 +76,13 @@ func main() {

printVersion()

metricsOpts := server.Options{
BindAddress: metricsAddr,
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Metrics: metricsOpts,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "cb305759.medik8s.io",
Expand Down

0 comments on commit 0b67dbc

Please sign in to comment.