Skip to content

Commit 0e89f76

Browse files
authored
fix(alerts): refine chart test (#660)
* fix(alerts): rename CA secret Signed-off-by: Richard Tief <richard.tief@sap.com> * fix(alerts): add ticks to test resources Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): split tests Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): add test description Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(alerts): use regular expression for exact match of a resource Signed-off-by: Richard Tief <richard.tief@sap.com> --------- Signed-off-by: Richard Tief <richard.tief@sap.com>
1 parent da9da20 commit 0e89f76

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

alerts/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ maintainers:
88
name: alerts
99
sources:
1010
- https://github.com/cloudoperators/greenhouse-extensions
11-
version: 0.19.7
11+
version: 0.19.8
1212
keywords:
1313
- prometheus-alertmanager
1414
dependencies:

alerts/charts/templates/certmanager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
labels:
2020
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
2121
spec:
22-
secretName: tls-alerts-{{ .Release.Namespace }}-root
22+
secretName: tls-alerts-{{ .Release.Namespace }}-root-ca
2323
duration: {{ .Values.alerts.certManager.rootCert.duration | default "43800h0m0s" | quote }}
2424
issuerRef:
2525
name: {{ .Release.Namespace }}-alerts-issuer

alerts/charts/templates/tests/test-alerts-config.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,22 @@ data:
4646
}
4747
{{- end }}
4848
49-
{{- if and .Values.alerts.alertmanager.ingress.enabled .Values.alerts.alertmanager.ingress.hosts .Values.alerts.certManager.enabled }}
50-
@test "Generated server certificate for the Prometheus Alertmanager to use" {
51-
verify "there is 1 issuer named '{{ .Release.Namespace }}-alerts-issuer'"
52-
verify "there is 1 issuer named '{{ .Release.Namespace }}-alerts-root-issuer"
53-
verify "there is 1 certificate named '{{ .Release.Namespace }}-alerts-root-cert'"
54-
verify "there is 1 certificate named 'alertmanager-{{ .Release.Namespace }}-cert'"
55-
verify "there is 1 certificate named 'prometheus-{{ .Release.Namespace }}-cert'"
56-
verify "there is 1 secret named 'tls-alertmanager-{{ .Release.Namespace }}'"
57-
verify "there is 1 secret named 'tls-prometheus-{{ .Release.Namespace }}"
49+
{{- if .Values.alerts.certManager.enabled }}
50+
@test "Generated server certificates for the Prometheus Alertmanager to use" {
51+
verify "there is 1 issuer named '^{{ .Release.Namespace }}-alerts-issuer$'"
52+
verify "there is 1 issuer named '^{{ .Release.Namespace }}-alerts-root-issuer$'"
53+
verify "there is 1 certificate named '^{{ .Release.Namespace }}-alerts-root-cert$'"
54+
verify "there is 1 certificate named '^alertmanager-{{ .Release.Namespace }}-cert$'"
55+
verify "there is 1 certificate named '^prometheus-{{ .Release.Namespace }}-cert$'"
56+
verify "there is 1 secret named '^tls-alertmanager-{{ .Release.Namespace }}$'"
57+
verify "there is 1 secret named '^tls-prometheus-{{ .Release.Namespace }}$'"
58+
}
59+
{{- end }}
5860
61+
{{- if and .Values.alerts.alertmanager.ingress.enabled .Values.alerts.alertmanager.ingress.hosts .Values.alerts.certManager.enabled }}
62+
@test "Verify the availability of the Alertmanager API by using the certificates created" {
5963
url="https://{{ first .Values.alerts.alertmanager.ingress.hosts }}/-/healthy"
64+
6065
run curl --cert /tls-assets/tls.crt --key /tls-assets/tls.key ${url}
6166
[ "$status" -eq "0" ]
6267
}

alerts/plugindefinition.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kind: PluginDefinition
66
metadata:
77
name: alerts
88
spec:
9-
version: 2.7.7
9+
version: 2.7.8
1010
weight: 0
1111
displayName: Alerts
1212
description: The Alerts Plugin consists of both Prometheus Alertmanager and Supernova, the holistic alert management UI
@@ -15,7 +15,7 @@ spec:
1515
helmChart:
1616
name: alerts
1717
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
18-
version: 0.19.7
18+
version: 0.19.8
1919
uiApplication:
2020
name: supernova
2121
version: "latest"

0 commit comments

Comments
 (0)