kubezero/charts/kubezero-metrics/charts/kube-prometheus-stack/charts/grafana/templates/tests/test.yaml

50 lines
1.5 KiB
YAML
Raw Normal View History

{{- if .Values.testFramework.enabled }}
2022-12-06 20:43:11 +00:00
{{- $root := . }}
apiVersion: v1
kind: Pod
metadata:
2022-12-06 20:43:11 +00:00
name: {{ include "grafana.fullname" . }}-test
labels:
{{- include "grafana.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
2022-08-24 15:13:39 +00:00
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
2022-12-06 20:43:11 +00:00
namespace: {{ include "grafana.namespace" . }}
spec:
2022-12-06 20:43:11 +00:00
serviceAccountName: {{ include "grafana.serviceAccountNameTest" . }}
{{- with .Values.testFramework.securityContext }}
securityContext:
{{- toYaml . | nindent 4 }}
{{- end }}
2022-12-06 20:43:11 +00:00
{{- if or .Values.image.pullSecrets .Values.global.imagePullSecrets }}
imagePullSecrets:
2022-12-06 20:43:11 +00:00
{{- include "grafana.imagePullSecrets" (dict "root" $root "imagePullSecrets" .Values.image.pullSecrets) | nindent 4 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
2022-12-06 20:43:11 +00:00
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
2022-12-06 20:43:11 +00:00
{{- tpl (toYaml .) $root | nindent 4 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
2022-12-06 20:43:11 +00:00
{{- toYaml . | nindent 4 }}
{{- end }}
containers:
- name: {{ .Release.Name }}-test
image: "{{ .Values.testFramework.image}}:{{ .Values.testFramework.tag }}"
imagePullPolicy: "{{ .Values.testFramework.imagePullPolicy}}"
command: ["/opt/bats/bin/bats", "-t", "/tests/run.sh"]
volumeMounts:
- mountPath: /tests
name: tests
readOnly: true
volumes:
2022-12-06 20:43:11 +00:00
- name: tests
configMap:
name: {{ include "grafana.fullname" . }}-test
restartPolicy: Never
{{- end }}