@@ -18,7 +18,6 @@ package main
1818
1919import (
2020 "context"
21- "crypto/tls"
2221 "flag"
2322 "math/rand"
2423 "os"
@@ -161,21 +160,11 @@ func main() {
161160 }
162161 }
163162
164- webhookOptions := webhook.Options {
165- Port : webhookPort ,
166- CertDir : webhookCertDir ,
167- TLSOpts : []func (* tls.Config ){
168- func (t * tls.Config ) {
169- t .MinVersion = tls .VersionTLS12
170- },
171- },
172- }
173-
174163 restConfig := ctrl .GetConfigOrDie ()
175164 restConfig .QPS = restConfigQPS
176165 restConfig .Burst = restConfigBurst
177166
178- _ , metricsOptions , err := flags .GetManagerOptions (managerOptions )
167+ tlsOptions , metricsOptions , err := flags .GetManagerOptions (managerOptions )
179168 if err != nil {
180169 setupLog .Error (err , "unable to start manager: invalid flags" )
181170 os .Exit (1 )
@@ -194,7 +183,11 @@ func main() {
194183 DefaultNamespaces : defaultNamespaces ,
195184 },
196185 HealthProbeBindAddress : healthAddr ,
197- WebhookServer : webhook .NewServer (webhookOptions ),
186+ WebhookServer : webhook .NewServer (webhook.Options {
187+ Port : webhookPort ,
188+ CertDir : webhookCertDir ,
189+ TLSOpts : tlsOptions ,
190+ }),
198191 })
199192 if err != nil {
200193 setupLog .Error (err , "unable to start manager" )
0 commit comments