Skip to content

Commit

Permalink
add caching rules via client and cache to main
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 1, 2024
1 parent 73e5375 commit 86689f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook"

natsv1alpha1 "github.com/kyma-project/nats-manager/api/v1alpha1"
controllercache "github.com/kyma-project/nats-manager/internal/controller/cache"
controllerclient "github.com/kyma-project/nats-manager/internal/controller/client"
natscontroller "github.com/kyma-project/nats-manager/internal/controller/nats"
"github.com/kyma-project/nats-manager/pkg/env"
"github.com/kyma-project/nats-manager/pkg/k8s"
Expand Down Expand Up @@ -112,8 +114,6 @@ func main() { //nolint:funlen // main function needs to initialize many objects
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: leaderElectionID,
Metrics: server.Options{BindAddress: metricsAddr},
WebhookServer: webhook.NewServer(webhook.Options{Port: metricsPort}),
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand All @@ -125,6 +125,10 @@ func main() { //nolint:funlen // main function needs to initialize many objects
// if you are doing or is intended to do any operation such as perform cleanups
// after the manager stops then its usage might be unsafe.
// LeaderElectionReleaseOnCancel: true,
Metrics: server.Options{BindAddress: metricsAddr},
WebhookServer: webhook.NewServer(webhook.Options{Port: metricsPort}),
NewCache: controllercache.New,
NewClient: controllerclient.New,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 86689f9

Please sign in to comment.