Skip to content

Commit aa45c3e

Browse files
authored
chore(alerts): improved chart tests (#657)
Signed-off-by: Richard Tief <richard.tief@sap.com>
1 parent 805a0c8 commit aa45c3e

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
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.5
11+
version: 0.19.6
1212
keywords:
1313
- prometheus-alertmanager
1414
dependencies:

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
type: integration-test
9+
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
910
data:
1011
run.sh: |-
1112
@@ -47,12 +48,15 @@ data:
4748
4849
{{- if and .Values.alerts.alertmanager.ingress.enabled .Values.alerts.alertmanager.ingress.hosts .Values.alerts.certManager.enabled }}
4950
@test "Generated server certificate for the Prometheus Alertmanager to use" {
50-
verify "there is 1 issuer named '{{ .Release.Namespace }}-monitoring-issuer'"
51+
verify "there is 1 issuer named '{{ .Release.Namespace }}-prometheus-issuer'"
52+
verify "there is 1 issuer named '{{ .Release.Namespace }}-prometheus-root-issuer'"
53+
verify "there is 1 certificate named '{{ .Release.Namespace }}-prometheus-root-cert'"
5154
verify "there is 1 certificate named '{{ include "kube-prometheus-stack.fullname" . }}-cert'"
52-
verify "there is 1 secret named '{{ include "kube-prometheus-stack.fullname" . }}-cert'"
55+
verify "there is 1 certificate named 'prometheus-{{ .Release.Namespace }}-cert'"
56+
verify "there is 1 secret named '{{ .Release.Namespace }}-prometheus-root-cert'"
57+
verify "there is 1 secret named 'tls-prometheus-{{ .Release.Namespace }}'"
5358
5459
url="https://{{ first .Values.alerts.alertmanager.ingress.hosts }}/-/healthy"
55-
5660
run curl --cert /tls-assets/tls.crt --key /tls-assets/tls.key ${url}
5761
[ "$status" -eq "0" ]
5862
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
type: integration-test
9+
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
910
annotations:
1011
"helm.sh/hook": test
1112
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
@@ -33,7 +34,7 @@ spec:
3334
- name: tls-cert
3435
secret:
3536
defaultMode: 420
36-
secretName: {{ print "tls-%s-prometheus-auth" $.Release.Namespace }}
37+
secretName: tls-prometheus-{{ .Release.Namespace }}
3738
{{- end }}
3839
restartPolicy: Never
3940
{{- end -}}

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.5
9+
version: 2.7.6
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.5
18+
version: 0.19.6
1919
uiApplication:
2020
name: supernova
2121
version: "latest"

0 commit comments

Comments
 (0)