From c4c814ac32cf1fd91e7fca9b8588cd52fe5717a5 Mon Sep 17 00:00:00 2001 From: Moshe Immerman Date: Mon, 23 Oct 2023 16:56:30 +0300 Subject: [PATCH] feat: add upstream-insecure-skip-verify arg --- chart/templates/deployment.yaml | 3 +++ chart/values.yaml | 1 + cmd/root.go | 1 + 3 files changed, 5 insertions(+) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 36cab6485..ca3a06dc6 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -155,6 +155,9 @@ spec: {{- if .Values.upstream.password }} - --upstream-password={{ .Values.upstream.password }} {{- end}} + {{- if .Values.upstream.insecureSkipVerify}} + - --upstream-insecure-skip-verify=true + {{- end}} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/chart/values.yaml b/chart/values.yaml index 09b7299ec..6ccf8ec32 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -76,6 +76,7 @@ upstream: host: "" user: "" password: "" + insecureSkipVerify: false # Alternative to inlining values, secret must contain: UPSTREAM_NAME, UPSTREAM_USER, UPSTREAM_PASSWORD & UPSTREAM_HOST secretKeyRef: name: diff --git a/cmd/root.go b/cmd/root.go index 6f3ce11a2..4805b3b1a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -75,6 +75,7 @@ func ServerFlags(flags *pflag.FlagSet) { flags.StringVar(&canary.UpstreamConf.Username, "upstream-user", os.Getenv("UPSTREAM_USER"), "upstream username") flags.StringVar(&canary.UpstreamConf.Password, "upstream-password", os.Getenv("UPSTREAM_PASSWORD"), "upstream password") flags.StringVar(&canary.UpstreamConf.AgentName, "agent-name", os.Getenv("UPSTREAM_NAME"), "name of this agent") + flags.BoolVar(&canary.UpstreamConf.InsecureSkipVerify, "upstream-insecure-skip-verify", os.Getenv("UPSTREAM_INSECURE_SKIP_VERIFY") == "true", "Skip TLS verification on the upstream servers certificate") } func readFromEnv(v string) string {