Skip to content

Commit 4b9b597

Browse files
committed
Re-add --webhook-bind-address flag
Re-adds support for configuring the webhook server port through the --webhook-bind-address command-line flag (default: 9443). This flag was previously removed and needs to be restored to support local development and testing scenarios. Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent c3c7c98 commit 4b9b597

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func main() {
103103
var enableLeaderElection bool
104104
var probeAddr string
105105
var pprofBindAddress string
106+
var webhookPort int
106107
var secureMetrics bool
107108
var enableHTTP2 bool
108109
var tlsOpts []func(*tls.Config)
@@ -122,6 +123,7 @@ func main() {
122123
flag.StringVar(&metricsCertName, "metrics-cert-name", "tls.crt", "The name of the metrics server certificate file.")
123124
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")
124125
flag.StringVar(&pprofBindAddress, "pprof-bind-address", "", "The address the pprof endpoint binds to. Set to empty to disable pprof.")
126+
flag.IntVar(&webhookPort, "webhook-bind-address", 9443, "The port the webhook server binds to.")
125127
flag.BoolVar(&enableHTTP2, "enable-http2", false,
126128
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
127129
opts := zap.Options{
@@ -173,6 +175,7 @@ func main() {
173175
}
174176

175177
webhookServer := webhook.NewServer(webhook.Options{
178+
Port: webhookPort,
176179
TLSOpts: webhookTLSOpts,
177180
})
178181

hack/run_with_local_webhook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,4 @@ else
303303
oc scale --replicas=0 -n openstack-operators deploy/telemetry-operator-controller-manager
304304
fi
305305

306-
go run ./cmdmain.go -metrics-bind-address ":${METRICS_PORT}" -health-probe-bind-address ":${HEALTH_PORT}" -pprof-bind-address ":${PPROF_PORT}" -webhook-bind-address "${WEBHOOK_PORT}"
306+
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)