From 044d369f4abfaaa9ae4affa672b343401366f35f Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Wed, 7 Feb 2024 12:43:44 +0530 Subject: [PATCH 1/2] chore: correct agent chart values --- chart/templates/deployment.yaml | 1 - chart/values.yaml | 2 +- cmd/root.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 9032e2ff3..d2f3fae54 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -141,7 +141,6 @@ spec: - --{{$k}}={{$v}} {{- end }} {{- if .Values.upstream.enabled }} - - --agent-name={{ .Values.upstream.agentName }} {{- if .Values.upstream.host }} - --upstream-host={{ .Values.upstream.host }} {{- end}} diff --git a/chart/values.yaml b/chart/values.yaml index 582e07858..92adc09be 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -85,7 +85,7 @@ upstream: user: "" password: "" insecureSkipVerify: false - # Alternative to inlining values, secret must contain: UPSTREAM_NAME, UPSTREAM_USER, UPSTREAM_PASSWORD & UPSTREAM_HOST + # Alternative to inlining values, secret must contain: AGENT_NAME, UPSTREAM_USER, UPSTREAM_PASSWORD & UPSTREAM_HOST secretKeyRef: name: diff --git a/cmd/root.go b/cmd/root.go index 1fbb0697f..d412a0d87 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -134,7 +134,7 @@ func ServerFlags(flags *pflag.FlagSet) { flags.StringVar(&canary.UpstreamConf.Host, "upstream-host", os.Getenv("UPSTREAM_HOST"), "central canary checker instance to push/pull canaries") 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.StringVar(&canary.UpstreamConf.AgentName, "agent-name", os.Getenv("AGENT_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") } From 0bbe688fc13857b66398478f19dd5f12523219fb Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Wed, 7 Feb 2024 13:24:27 +0530 Subject: [PATCH 2/2] chore: set default agent name empty --- chart/templates/deployment.yaml | 3 +++ chart/values.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index d2f3fae54..688d05b21 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -150,6 +150,9 @@ spec: {{- if .Values.upstream.password }} - --upstream-password={{ .Values.upstream.password }} {{- end}} + {{- if .Values.upstream.agentName }} + - --agent-name={{ .Values.upstream.agentName }} + {{- end}} {{- if .Values.upstream.insecureSkipVerify}} - --upstream-insecure-skip-verify=true {{- end}} diff --git a/chart/values.yaml b/chart/values.yaml index 92adc09be..3adea1544 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -80,7 +80,7 @@ data: upstream: enabled: false - agentName: default-agent + agentName: "" host: "" user: "" password: ""