Skip to content

Commit ab6ae95

Browse files
Merge pull request #1704 from stuggi/operator_sdk_1.41.1_pprofBindAddress
Re-add --webhook-bind-address flag
2 parents 324f330 + da555b1 commit ab6ae95

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func main() {
141141
var enableLeaderElection bool
142142
var probeAddr string
143143
var pprofAddr string
144+
var webhookPort int
144145
var secureMetrics bool
145146
var enableHTTP2 bool
146147
var tlsOpts []func(*tls.Config)
@@ -160,6 +161,7 @@ func main() {
160161
"The directory that contains the metrics server certificate.")
161162
flag.StringVar(&metricsCertName, "metrics-cert-name", "tls.crt", "The name of the metrics server certificate file.")
162163
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")
164+
flag.IntVar(&webhookPort, "webhook-bind-address", 9443, "The port the webhook server binds to.")
163165
flag.BoolVar(&enableHTTP2, "enable-http2", false,
164166
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
165167
opts := zap.Options{
@@ -211,6 +213,7 @@ func main() {
211213
}
212214

213215
webhookServer := webhook.NewServer(webhook.Options{
216+
Port: webhookPort,
214217
TLSOpts: webhookTLSOpts,
215218
})
216219

hack/run_with_local_webhook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,4 +407,4 @@ if [ -n "${CSV_NAME}" ]; then
407407
fi
408408

409409
source hack/export_related_images.sh && \
410-
go run ./main.go -metrics-bind-address ":${METRICS_PORT}" -health-probe-bind-address ":${HEALTH_PORT}" -pprof-bind-address ":${PPROF_PORT}" -webhook-bind-address "${WEBHOOK_PORT}"
410+
go run ./cmd/main.go -metrics-bind-address ":${METRICS_PORT}" -health-probe-bind-address ":${HEALTH_PORT}" -pprof-bind-address ":${PPROF_PORT}" -webhook-bind-address "${WEBHOOK_PORT}"

0 commit comments

Comments
 (0)