From 748e0fcd04f65a4992a4dc93e9e6a5508fd28e27 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Fri, 16 Dec 2022 23:47:26 +0000 Subject: [PATCH] fix: fix helm prometheus block causing failures --- helm/templates/coder.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index 44847032a0d24..85b01254a51e9 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -89,12 +89,20 @@ spec: protocol: TCP {{- end }} {{- range .Values.coder.env }} - {{- if and (eq .name "CODER_PROMETHEUS_ENABLE") (eq .value "true") }} + {{- if eq .name "CODER_PROMETHEUS_ENABLE" }} + {{/* + This sadly has to be nested to avoid evaluating the second part + of the condition too early and potentially getting type errors if + the value is not a string (like a `valueFrom`). We do not support + `valueFrom` for this env var specifically. + */}} + {{- if eq .value "true" }} - name: "prometheus-http" containerPort: 6060 protocol: TCP {{- end }} {{- end }} + {{- end }} readinessProbe: httpGet: path: /api/v2/buildinfo