Skip to content

Commit 195c99a

Browse files
committed
Add pprof-bind-address option to main.go's
Jira: OSPRH-17235
1 parent d07a22a commit 195c99a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/operator/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ func main() {
6262
var enableLeaderElection bool
6363
var probeAddr string
6464
var enableHTTP2 bool
65+
var pprofAddr string
6566
flag.BoolVar(&enableHTTP2, "enable-http2", enableHTTP2, "If HTTP/2 should be enabled for the metrics and webhook servers.")
6667
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
6768
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
69+
flag.StringVar(&pprofAddr, "pprof-bind-address", "", "The address the pprof endpoint binds to. Set to empty to disable pprof")
6870
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
6971
"Enable leader election for controller manager. "+
7072
"Enabling this will ensure there is only one active controller manager.")
@@ -93,6 +95,7 @@ func main() {
9395
Metrics: metricsserver.Options{
9496
BindAddress: metricsAddr,
9597
},
98+
PprofBindAddress: pprofAddr,
9699
HealthProbeBindAddress: probeAddr,
97100
LeaderElection: enableLeaderElection,
98101
LeaderElectionID: "20ca801f.openstack.org",

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ func main() {
139139
var metricsAddr string
140140
var enableLeaderElection bool
141141
var probeAddr string
142+
var pprofAddr string
142143
var enableHTTP2 bool
143144
flag.BoolVar(&enableHTTP2, "enable-http2", enableHTTP2, "If HTTP/2 should be enabled for the metrics and webhook servers.")
144145
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
145146
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
147+
flag.StringVar(&pprofAddr, "pprof-bind-address", "", "The address the pprof endpoint binds to. Set to empty to disable pprof")
146148
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
147149
"Enable leader election for controller manager. "+
148150
"Enabling this will ensure there is only one active controller manager.")
@@ -171,6 +173,7 @@ func main() {
171173
Metrics: metricsserver.Options{
172174
BindAddress: metricsAddr,
173175
},
176+
PprofBindAddress: pprofAddr,
174177
HealthProbeBindAddress: probeAddr,
175178
LeaderElection: enableLeaderElection,
176179
LeaderElectionID: "40ba705e.openstack.org",

0 commit comments

Comments
 (0)