From 9d32abf486a45ff3dfc2d6177a36e1bc2a244012 Mon Sep 17 00:00:00 2001 From: Thibault VINCENT Date: Mon, 25 May 2026 13:59:25 +0200 Subject: [PATCH] fix(chart): use backticks instead of double quotes in alert descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #400. AlertManager descriptions wrapped subject_CN, issuer_CN, secret_namespace/secret_name and filepath in double quotes, which broke parsing when the description was reinjected into JSON-bearing webhook payloads (Teams Adaptive Cards, custom receivers). Switch to backticks: no JSON escaping required, Slack/Teams/Discord render them as inline code spans, plain-text destinations still show the value clearly. The surrounding Helm template machinery is unchanged — only the literal quote characters around the placeholders flip from " to `. --- chart/templates/prometheusrule.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chart/templates/prometheusrule.yaml b/chart/templates/prometheusrule.yaml index 418c6db..e99edd1 100644 --- a/chart/templates/prometheusrule.yaml +++ b/chart/templates/prometheusrule.yaml @@ -46,7 +46,7 @@ spec: {{- end }} annotations: summary: Certificate cannot be decoded - description: Certificate could not be decoded {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret "{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}"{{ "{{else}}" }}at location "{{ "{{" }} $labels.filepath {{ "}}" }}"{{ "{{end}}" }} + description: Certificate could not be decoded {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret `{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}`{{ "{{else}}" }}at location `{{ "{{" }} $labels.filepath {{ "}}" }}`{{ "{{end}}" }} {{- if .Values.prometheusRules.alertExtraAnnotations }} {{- toYaml .Values.prometheusRules.alertExtraAnnotations | nindent 8 }} {{- end }} @@ -61,7 +61,7 @@ spec: {{- end }} annotations: summary: Certificate should be renewed - description: Certificate for "{{ "{{" }} $labels.subject_CN {{ "}}" }}" should be renewed as it expires in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret "{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}"{{ "{{else}}" }}at location "{{ "{{" }} $labels.filepath {{ "}}" }}"{{ "{{end}}" }} + description: Certificate for `{{ "{{" }} $labels.subject_CN {{ "}}" }}` should be renewed as it expires in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret `{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}`{{ "{{else}}" }}at location `{{ "{{" }} $labels.filepath {{ "}}" }}`{{ "{{end}}" }} {{- if .Values.prometheusRules.alertExtraAnnotations }} {{- toYaml .Values.prometheusRules.alertExtraAnnotations | nindent 8 }} {{- end }} @@ -75,7 +75,7 @@ spec: {{- end }} annotations: summary: Certificate is about to expire - description: Certificate for "{{ "{{" }} $labels.subject_CN {{ "}}" }}" is about to expire in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret "{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}"{{ "{{else}}" }}at location "{{ "{{" }} $labels.filepath {{ "}}" }}"{{ "{{end}}" }} + description: Certificate for `{{ "{{" }} $labels.subject_CN {{ "}}" }}` is about to expire in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret `{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}`{{ "{{else}}" }}at location `{{ "{{" }} $labels.filepath {{ "}}" }}`{{ "{{end}}" }} {{- if .Values.prometheusRules.alertExtraAnnotations }} {{- toYaml .Values.prometheusRules.alertExtraAnnotations | nindent 8 }} {{- end }} @@ -90,7 +90,7 @@ spec: {{- end }} annotations: summary: CRL needs to be refreshed - description: CRL issued by "{{ "{{" }} $labels.issuer_CN {{ "}}" }}" reaches its nextUpdate in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret "{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}"{{ "{{else}}" }}at location "{{ "{{" }} $labels.filepath {{ "}}" }}"{{ "{{end}}" }} + description: CRL issued by `{{ "{{" }} $labels.issuer_CN {{ "}}" }}` reaches its nextUpdate in {{`{{`}} humanizeDuration $value {{`}}`}} {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret `{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}`{{ "{{else}}" }}at location `{{ "{{" }} $labels.filepath {{ "}}" }}`{{ "{{end}}" }} {{- if .Values.prometheusRules.alertExtraAnnotations }} {{- toYaml .Values.prometheusRules.alertExtraAnnotations | nindent 8 }} {{- end }} @@ -104,7 +104,7 @@ spec: {{- end }} annotations: summary: CRL is stale (past its nextUpdate) - description: CRL issued by "{{ "{{" }} $labels.issuer_CN {{ "}}" }}" is past its nextUpdate — clients validating against this CRL are likely to reject the issuer's certs {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret "{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}"{{ "{{else}}" }}at location "{{ "{{" }} $labels.filepath {{ "}}" }}"{{ "{{end}}" }} + description: CRL issued by `{{ "{{" }} $labels.issuer_CN {{ "}}" }}` is past its nextUpdate — clients validating against this CRL are likely to reject the issuer's certs {{ "{{if" }} $labels.secret_name {{ "}}" }}in Kubernetes secret `{{ "{{" }} $labels.secret_namespace {{ "}}" }}/{{ "{{" }} $labels.secret_name {{ "}}" }}`{{ "{{else}}" }}at location `{{ "{{" }} $labels.filepath {{ "}}" }}`{{ "{{end}}" }} {{- if .Values.prometheusRules.alertExtraAnnotations }} {{- toYaml .Values.prometheusRules.alertExtraAnnotations | nindent 8 }} {{- end }}