Skip to content

Commit 69f0f35

Browse files
committed
feat(controller): disable http2
Disable http2 usage in all servers started by controller manager
1 parent abffe3d commit 69f0f35

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

cmd/operator/operator.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package operator
1818

1919
import (
2020
"context"
21+
"crypto/tls"
2122
"fmt"
2223
"net/http"
2324
"os"
@@ -32,8 +33,8 @@ import (
3233
"github.com/openshift/lvm-operator/v4/internal/controllers/lvmcluster"
3334
"github.com/openshift/lvm-operator/v4/internal/controllers/lvmcluster/logpassthrough"
3435
"github.com/openshift/lvm-operator/v4/internal/controllers/node/removal"
35-
"github.com/openshift/lvm-operator/v4/internal/controllers/persistent-volume"
36-
"github.com/openshift/lvm-operator/v4/internal/controllers/persistent-volume-claim"
36+
persistent_volume "github.com/openshift/lvm-operator/v4/internal/controllers/persistent-volume"
37+
persistent_volume_claim "github.com/openshift/lvm-operator/v4/internal/controllers/persistent-volume-claim"
3738
internalCSI "github.com/openshift/lvm-operator/v4/internal/csi"
3839
"github.com/openshift/lvm-operator/v4/internal/migration/microlvms"
3940
"github.com/spf13/cobra"
@@ -186,9 +187,15 @@ func run(cmd *cobra.Command, _ []string, opts *Options) error {
186187
BindAddress: opts.diagnosticsAddr,
187188
SecureServing: true,
188189
FilterProvider: filters.WithAuthenticationAndAuthorization,
190+
TLSOpts: []func(*tls.Config){
191+
func(c *tls.Config) { c.NextProtos = []string{"http/1.1"} },
192+
},
189193
},
190194
WebhookServer: &webhook.DefaultServer{Options: webhook.Options{
191195
Port: 9443,
196+
TLSOpts: []func(*tls.Config){
197+
func(c *tls.Config) { c.NextProtos = []string{"http/1.1"} },
198+
},
192199
}},
193200
Cache: cache.Options{
194201
DefaultTransform: NoManagedFields,

cmd/vgmanager/vgmanager.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package vgmanager
1818

1919
import (
2020
"context"
21+
"crypto/tls"
2122
"errors"
2223
"fmt"
2324
"net/http"
@@ -125,9 +126,21 @@ func run(cmd *cobra.Command, _ []string, opts *Options) error {
125126
BindAddress: opts.diagnosticsAddr,
126127
SecureServing: true,
127128
FilterProvider: filters.WithAuthenticationAndAuthorization,
129+
TLSOpts: []func(*tls.Config){
130+
func(c *tls.Config) {
131+
opts.SetupLog.Info("disabling http/2")
132+
c.NextProtos = []string{"http/1.1"}
133+
},
134+
},
128135
},
129136
WebhookServer: &webhook.DefaultServer{Options: webhook.Options{
130137
Port: 9443,
138+
TLSOpts: []func(*tls.Config){
139+
func(c *tls.Config) {
140+
opts.SetupLog.Info("disabling http/2")
141+
c.NextProtos = []string{"http/1.1"}
142+
},
143+
},
131144
}},
132145
HealthProbeBindAddress: opts.healthProbeAddr,
133146
LeaderElection: false,

0 commit comments

Comments
 (0)