File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ func main() {
7575 kingpin .FatalIfError (err , "Cannot get API server rest config" )
7676 kingpin .FatalIfError (linodemetrics .SetupMetrics (), "Cannot setup Linode metrics hook" )
7777
78- mgr , err := ctrl . NewManager ( ratelimiter . LimitRESTConfig ( cfg , * maxReconcileRate ), ctrl.Options {
78+ opts := ctrl.Options {
7979 LeaderElection : * leaderElection ,
8080 LeaderElectionID : "crossplane-leader-election-provider-linode-config" ,
8181 Cache : cache.Options {
@@ -84,7 +84,14 @@ func main() {
8484 LeaderElectionResourceLock : resourcelock .LeasesResourceLock ,
8585 LeaseDuration : func () * time.Duration { d := 60 * time .Second ; return & d }(),
8686 RenewDeadline : func () * time.Duration { d := 50 * time .Second ; return & d }(),
87- })
87+ }
88+
89+ // Enable pprof when debug is enabled.
90+ if * debug {
91+ opts .PprofBindAddress = ":8082"
92+ }
93+
94+ mgr , err := ctrl .NewManager (ratelimiter .LimitRESTConfig (cfg , * maxReconcileRate ), opts )
8895 kingpin .FatalIfError (err , "Cannot create controller manager" )
8996 kingpin .FatalIfError (apis .AddToScheme (mgr .GetScheme ()), "Cannot add Linode APIs to scheme" )
9097
You can’t perform that action at this time.
0 commit comments