Skip to content

Commit

Permalink
Add pprof-addr CLI flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Feb 11, 2025
1 parent b0a0fd3 commit 2a38037
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ type reconcilerConfig struct {

func main() {
var reconcilerCfg reconcilerConfig
var kubecontext, probeAddr string
var kubecontext, probeAddr, pprofAddr string
var enableLeaderElection bool
flag.StringVar(&reconcilerCfg.metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&kubecontext, "kubecontext", "", "The context to use from the kubeconfig (defaults to current-context)")
flag.StringVar(&probeAddr, "health-addr", ":8081", "The address the probe endpoint binds to.")
flag.StringVar(&pprofAddr, "pprof-addr", "", "The address the pprof endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
Expand Down Expand Up @@ -114,6 +115,7 @@ func main() {
LeaderElectionID: constants.LeaderElectionID,
RetryPeriod: &leaderElectionRetry,
GracefulShutdownTimeout: &shutdownTimeout,
PprofBindAddress: pprofAddr,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 2a38037

Please sign in to comment.