Skip to content

Commit

Permalink
refactor(webhooks)!: removing tls-min-version flag
Browse files Browse the repository at this point in the history
Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
  • Loading branch information
prometherion committed Jun 1, 2023
1 parent bd043ff commit 82019d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ You can find all deprecations in [this overview](https://github.com/kedacore/ked
New deprecation(s):

- **Azure Data Explorer**: Deprecate `metadata.clientSecret` ([#4514](https://github.com/kedacore/keda/issues/4514))
- **Webhook command**: Removing CLI flag `--tls-min-version` (discussion: [#4582](https://github.com/kedacore/keda/pull/4582#discussion_r1209547634))


### Breaking Changes
Expand Down
12 changes: 2 additions & 10 deletions cmd/webhooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package main
import (
"crypto/tls"
"flag"
"fmt"
"os"

"github.com/spf13/pflag"
Expand Down Expand Up @@ -57,13 +56,12 @@ func main() {
var webhooksClientRequestQPS float32
var webhooksClientRequestBurst int
var certDir string
var tlsMinVersion string

pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
pflag.Float32Var(&webhooksClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
pflag.IntVar(&webhooksClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
pflag.StringVar(&certDir, "cert-dir", "/certs", "Webhook certificates dir to use. Defaults to /certs")
pflag.StringVar(&tlsMinVersion, "tls-min-version", "1.3", "Minimum TLS version")

opts := zap.Options{}
opts.BindFlags(flag.CommandLine)
Expand All @@ -77,12 +75,6 @@ func main() {
cfg := ctrl.GetConfigOrDie()
cfg.QPS = webhooksClientRequestQPS
cfg.Burst = webhooksClientRequestBurst
// Configuring minimum TLS version for the webhook server
minTLSVersion, err := kedautil.ParseTLSMinVersionAsString(tlsMinVersion)
if err != nil {
setupLog.Error(fmt.Errorf("unsupported minimum TLS version"), fmt.Sprintf("option %s non recognized", tlsMinVersion))
os.Exit(1)
}

mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
Expand All @@ -93,7 +85,7 @@ func main() {
CertDir: certDir,
TLSOpts: []func(tlsConfig *tls.Config){
func(tlsConfig *tls.Config) {
tlsConfig.MinVersion = minTLSVersion
tlsConfig.MinVersion = kedautil.GetMinTLSVersion()
},
},
}),
Expand Down

0 comments on commit 82019d1

Please sign in to comment.