Skip to content

Commit

Permalink
Merge pull request #375 from iurygregory/OCPBUGS-20572
Browse files Browse the repository at this point in the history
OCPBUGS-20572: Obsolete protocols for webhook
  • Loading branch information
openshift-merge-bot[bot] committed Dec 6, 2023
2 parents 8116365 + 3e3e559 commit 95e6cbe
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Expand Up @@ -17,6 +17,7 @@ package main

import (
"context"
"crypto/tls"
"flag"
"os"

Expand All @@ -30,6 +31,7 @@ import (
"k8s.io/klog/v2/klogr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/webhook"

// +kubebuilder:scaffold:imports

Expand Down Expand Up @@ -81,14 +83,22 @@ func main() {
}

config := ctrl.GetConfigOrDie()

mgr, err := ctrl.NewManager(config, ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
WebhookServer: webhook.NewServer(webhook.Options{
Port: 9443,
TLSOpts: []func(*tls.Config){
func(t *tls.Config) {
t.MinVersion = tls.VersionTLS12
},
},
CertDir: "/etc/cluster-baremetal-operator/tls",
}),
NewCache: cache.MultiNamespacedCacheBuilder(
[]string{controllers.ComponentNamespace, provisioning.OpenshiftConfigNamespace}),
LeaderElection: enableLeaderElection,
Port: 9443,
CertDir: "/etc/cluster-baremetal-operator/tls",
})
if err != nil {
klog.ErrorS(err, "unable to start manager")
Expand Down

0 comments on commit 95e6cbe

Please sign in to comment.