Skip to content

Commit

Permalink
Merge pull request #725 from openshift-kni/more-config
Browse files Browse the repository at this point in the history
operator: enhance configurability
  • Loading branch information
openshift-ci[bot] authored Oct 19, 2023
2 parents 0a8bbd7 + cddb74c commit c7b92ce
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ import (
//+kubebuilder:scaffold:imports
)

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

var (
scheme = k8sruntime.NewScheme()

Expand All @@ -84,6 +89,7 @@ type RenderParams struct {
}

func main() {
var webhookPort int
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
Expand Down Expand Up @@ -114,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 @@ -193,11 +200,11 @@ func main() {
Namespace: namespace,
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Port: webhookPort,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionNamespace: namespace,
LeaderElectionID: "0e2a6bd3.openshift-kni.io",
LeaderElectionID: defaultLeaderElectionID,
TLSOpts: webhookTLSOpts(enableHTTP2),
})
if err != nil {
Expand Down

0 comments on commit c7b92ce

Please sign in to comment.