Skip to content

Commit fc88b93

Browse files
Add flag to allow usage of pprof in operator-controller (disabled by default) as it is available for catalogd (#1875)
1 parent ef005a2 commit fc88b93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/operator-controller/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ var (
8383

8484
type config struct {
8585
metricsAddr string
86+
pprofAddr string
8687
certFile string
8788
keyFile string
8889
enableLeaderElection bool
@@ -131,6 +132,7 @@ func init() {
131132
//create flagset, the collection of flags for this command
132133
flags := operatorControllerCmd.Flags()
133134
flags.StringVar(&cfg.metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
135+
flags.StringVar(&cfg.pprofAddr, "pprof-bind-address", "0", "The address the pprof endpoint binds to. an empty string or 0 disables pprof")
134136
flags.StringVar(&cfg.probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
135137
flags.StringVar(&cfg.catalogdCasDir, "catalogd-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to the Catalogd web service.")
136138
flags.StringVar(&cfg.pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
@@ -265,6 +267,7 @@ func run() error {
265267
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
266268
Scheme: scheme.Scheme,
267269
Metrics: metricsServerOptions,
270+
PprofBindAddress: cfg.pprofAddr,
268271
HealthProbeBindAddress: cfg.probeAddr,
269272
LeaderElection: cfg.enableLeaderElection,
270273
LeaderElectionID: "9c4404e7.operatorframework.io",

0 commit comments

Comments
 (0)