Skip to content

Commit

Permalink
Align code with upstream changes in controller-runtime
Browse files Browse the repository at this point in the history
Deprecated fields have been removed upstream.

Signed-off-by: Max Jonas Werner <[email protected]>
  • Loading branch information
Max Jonas Werner committed Nov 21, 2023
1 parent e120ce9 commit c141f74
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
ctrl "sigs.k8s.io/controller-runtime"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/fluxcd/pkg/runtime/logger"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
Expand Down Expand Up @@ -63,12 +65,12 @@ func main() {
ctrl.SetLogger(logger.NewLogger(logOptions))

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
LeaderElection: enableLeaderElection,
LeaderElectionID: "source-watcher.fluxcd.io",
Logger: ctrl.Log,
Scheme: scheme,
Metrics: metricsserver.Options{BindAddress: metricsAddr},
WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
LeaderElection: enableLeaderElection,
LeaderElectionID: "source-watcher.fluxcd.io",
Logger: ctrl.Log,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit c141f74

Please sign in to comment.