From b7e5ce71c552fa8642e16b24599111d2ec68855f Mon Sep 17 00:00:00 2001 From: Andrew Drake Date: Tue, 8 Oct 2019 16:37:51 -0700 Subject: [PATCH] [stable/grafana] Add variable to disable creating test resources (#17757) Signed-off-by: Andrew Drake --- stable/grafana/Chart.yaml | 2 +- stable/grafana/README.md | 1 + stable/grafana/templates/tests/test-configmap.yaml | 2 ++ stable/grafana/templates/tests/test-podsecuritypolicy.yaml | 2 +- stable/grafana/templates/tests/test-role.yaml | 2 +- stable/grafana/templates/tests/test-rolebinding.yaml | 2 +- stable/grafana/templates/tests/test-serviceaccount.yaml | 2 +- stable/grafana/templates/tests/test.yaml | 2 ++ stable/grafana/values.yaml | 1 + 9 files changed, 11 insertions(+), 5 deletions(-) diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index 86d0bb2ce5..9b2d17bf24 100644 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: grafana -version: 3.8.19 +version: 3.9.0 appVersion: 6.3.5 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 5298b46300..c18981596f 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -129,6 +129,7 @@ The command removes all the Kubernetes components associated with the chart and | `rbac.extraRoleRules` | Additional rules to add to the Role | [] | | `rbac.extraClusterRoleRules` | Additional rules to add to the ClusterRole | [] | | `command` | Define command to be executed by grafana container at startup | `nil` | +| `testFramework.enabled` | Whether to create test-related resources | `true` | | `testFramework.image` | `test-framework` image repository. | `dduportal/bats` | | `testFramework.tag` | `test-framework` image tag. | `0.4.0` | | `testFramework.securityContext` | `test-framework` securityContext | `{}` | diff --git a/stable/grafana/templates/tests/test-configmap.yaml b/stable/grafana/templates/tests/test-configmap.yaml index 25746ce0c5..bf5bde3ae6 100644 --- a/stable/grafana/templates/tests/test-configmap.yaml +++ b/stable/grafana/templates/tests/test-configmap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.testFramework.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -16,3 +17,4 @@ data: code=$(curl -s -o /dev/null -I -w "%{http_code}" $url) [ "$code" == "200" ] } +{{- end }} diff --git a/stable/grafana/templates/tests/test-podsecuritypolicy.yaml b/stable/grafana/templates/tests/test-podsecuritypolicy.yaml index c9245b24f9..662d4a2376 100644 --- a/stable/grafana/templates/tests/test-podsecuritypolicy.yaml +++ b/stable/grafana/templates/tests/test-podsecuritypolicy.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rbac.pspEnabled }} +{{- if and .Values.testFramework.enabled .Values.rbac.pspEnabled }} apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: diff --git a/stable/grafana/templates/tests/test-role.yaml b/stable/grafana/templates/tests/test-role.yaml index c9e908e5f2..9d34fbdd68 100644 --- a/stable/grafana/templates/tests/test-role.yaml +++ b/stable/grafana/templates/tests/test-role.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rbac.pspEnabled -}} +{{- if and .Values.testFramework.enabled .Values.rbac.pspEnabled -}} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: diff --git a/stable/grafana/templates/tests/test-rolebinding.yaml b/stable/grafana/templates/tests/test-rolebinding.yaml index 746c27dc70..0a11db2f06 100644 --- a/stable/grafana/templates/tests/test-rolebinding.yaml +++ b/stable/grafana/templates/tests/test-rolebinding.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rbac.pspEnabled -}} +{{- if and .Values.testFramework.enabled .Values.rbac.pspEnabled -}} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/stable/grafana/templates/tests/test-serviceaccount.yaml b/stable/grafana/templates/tests/test-serviceaccount.yaml index 6e2cb0107f..e6a46f92f2 100644 --- a/stable/grafana/templates/tests/test-serviceaccount.yaml +++ b/stable/grafana/templates/tests/test-serviceaccount.yaml @@ -1,4 +1,4 @@ -{{- if .Values.serviceAccount.create }} +{{- if and .Values.testFramework.enabled .Values.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/stable/grafana/templates/tests/test.yaml b/stable/grafana/templates/tests/test.yaml index 69cce64fe8..e0e4883bcf 100644 --- a/stable/grafana/templates/tests/test.yaml +++ b/stable/grafana/templates/tests/test.yaml @@ -1,3 +1,4 @@ +{{- if .Values.testFramework.enabled }} apiVersion: v1 kind: Pod metadata: @@ -63,3 +64,4 @@ spec: - name: tools emptyDir: {} restartPolicy: Never +{{- end }} diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index efe6453874..68cfb94e68 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -54,6 +54,7 @@ image: # - myRegistrKeySecretName testFramework: + enabled: true image: "dduportal/bats" tag: "0.4.0" securityContext: {}