Skip to content

Commit

Permalink
operator: make port configurable
Browse files Browse the repository at this point in the history
add option to change the listening port. Defaults are unchanged.

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Oct 19, 2023
1 parent 075e7a8 commit cddb74c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
)

const (
webhookPort = 9443
defaultLeaderElectionID = "0e2a6bd3.openshift-kni.io" // autogenerated
)

Expand Down Expand Up @@ -88,6 +89,7 @@ type RenderParams struct {
}

func main() {
var webhookPort int
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
Expand Down Expand Up @@ -118,6 +120,7 @@ func main() {
flag.BoolVar(&showVersion, "version", false, "outputs the version and exit")
flag.BoolVar(&enableScheduler, "enable-scheduler", false, "enable support for the NUMAResourcesScheduler object")
flag.BoolVar(&enableWebhooks, "enable-webhooks", false, "enable conversion webhooks")
flag.IntVar(&webhookPort, "webhook-port", webhookPort, "The port the operator webhook should listen to.")
flag.BoolVar(&enableMetrics, "enable-metrics", false, "enable metrics server")
flag.BoolVar(&enableHTTP2, "enable-http2", false, "If HTTP/2 should be enabled for the webhook servers.")

Expand Down Expand Up @@ -197,7 +200,7 @@ func main() {
Namespace: namespace,
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Port: webhookPort,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionNamespace: namespace,
Expand Down

0 comments on commit cddb74c

Please sign in to comment.