From dc5eba43c22b801640945685d39df6df03ccf99e Mon Sep 17 00:00:00 2001 From: Sven Tennie Date: Thu, 28 Apr 2022 14:03:47 +0200 Subject: [PATCH 1/2] Prevent duplicated rendering of FEATURE_ENABLE_PAYMENT If the FEATURE_ENABLE_PAYMENT feature flag is set by envVars, do not render it again. Otherwise, we might end up in confusing cases like: The flag was set to true, but it's additionally rendered with a default to false. --- charts/team-settings/templates/deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/team-settings/templates/deployment.yaml b/charts/team-settings/templates/deployment.yaml index f0f21f0e26..467d632445 100644 --- a/charts/team-settings/templates/deployment.yaml +++ b/charts/team-settings/templates/deployment.yaml @@ -40,10 +40,13 @@ spec: value: https://{{ .Values.config.externalUrls.backendRest }} - name: BACKEND_WS value: wss://{{ .Values.config.externalUrls.backendWebsocket }} + + {{- if not (hasKey .Values.envVars "FEATURE_ENABLE_PAYMENT") }} # NOTE defaults to 'true', but since we assume on-prem here, we default to 'false' # SRC https://github.com/wireapp/wire-web-config-default/blob/master/wire-team-settings/.env.defaults#L48 - name: FEATURE_ENABLE_PAYMENT value: {{ .Values.config.enablePayment | default false | quote }} + {{- end }} {{- range $key, $val := .Values.envVars }} - name: {{ $key }} value: {{ $val | quote }} From e6d244a6e376b251d76aa699cca0997c46273b24 Mon Sep 17 00:00:00 2001 From: Sven Tennie Date: Fri, 29 Apr 2022 13:05:32 +0200 Subject: [PATCH 2/2] fixup! Prevent duplicated rendering of FEATURE_ENABLE_PAYMENT --- .../fix-duplicated-enable-payment-flag-in-helm-charts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog.d/3-bug-fixes/fix-duplicated-enable-payment-flag-in-helm-charts diff --git a/changelog.d/3-bug-fixes/fix-duplicated-enable-payment-flag-in-helm-charts b/changelog.d/3-bug-fixes/fix-duplicated-enable-payment-flag-in-helm-charts new file mode 100644 index 0000000000..e739347931 --- /dev/null +++ b/changelog.d/3-bug-fixes/fix-duplicated-enable-payment-flag-in-helm-charts @@ -0,0 +1,4 @@ +When `config.enablePayment` and `FEATURE_ENABLE_PAYMENT` (`envVars`) were set, +the team-settings feature flag `FEATURE_ENABLE_PAYMENT` was rendered two times. +The new behavior is to give the `envVars` entry priority. I.e. when it's set, +it's used instead of the `config.enablePayment` value.