From 17cfa5bba9a41ac9d2c4bff4d926b48f754a725e Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Wed, 25 Oct 2023 11:29:14 +0200 Subject: [PATCH] disable http2 follow up --- main.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index c4a6b521..b8bf7531 100644 --- a/main.go +++ b/main.go @@ -118,6 +118,13 @@ func main() { } + disableHTTP2 := func(c *tls.Config) { + if enableHTTP2 { + return + } + c.NextProtos = []string{"http/1.1"} + } + options := ctrl.Options{ Scheme: scheme, MetricsBindAddress: metricsAddr, @@ -125,6 +132,7 @@ func main() { HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "576d6738.openstack.org", + TLSOpts: []func(config *tls.Config){disableHTTP2}, } // create multi namespace cache if list of namespaces @@ -159,13 +167,6 @@ func main() { os.Exit(1) } - disableHTTP2 := func(c *tls.Config) { - if enableHTTP2 { - return - } - c.NextProtos = []string{"http/1.1"} - } - checker := healthz.Ping if strings.ToLower(os.Getenv("ENABLE_WEBHOOKS")) != "false" { enableWebhooks = true