From fabd5710eda98df8f065a63d01ab0689991340c8 Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Wed, 11 Dec 2024 08:47:03 +0100 Subject: [PATCH] [FEATURE] add tests for ingress resource and permissions Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/templates/tests/test-config.yaml | 6 ++++++ charts/perses/templates/tests/test-permissions.yaml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/charts/perses/templates/tests/test-config.yaml b/charts/perses/templates/tests/test-config.yaml index 4eae4fe..798706d 100644 --- a/charts/perses/templates/tests/test-config.yaml +++ b/charts/perses/templates/tests/test-config.yaml @@ -37,4 +37,10 @@ data: try "at most 3 times every 5s to get persistentvolumeclaims named '{{ include "perses.fullname" . }}.*' and verify that '.status.phase' is 'Bound'" } {{- end -}} + + {{- if .Values.ingress.enabled }} + @test "Verify successful creation of ingress resource" { + verify "there is 1 ingress named '^{{ include "perses.fullname" . }}$'" + } + {{- end -}} {{- end -}} diff --git a/charts/perses/templates/tests/test-permissions.yaml b/charts/perses/templates/tests/test-permissions.yaml index 8cbdd14..42d380f 100644 --- a/charts/perses/templates/tests/test-permissions.yaml +++ b/charts/perses/templates/tests/test-permissions.yaml @@ -29,6 +29,9 @@ rules: - apiGroups: [""] resources: ["pods", "persistentvolumeclaims", "services", "configmaps"] verbs: ["get", "list"] + - apiGroups: ["networking.k8s.io"] + resources: ["ingresses"] + verbs: ["get", "list"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding