| {{- if .Values.testFramework.enabled }} |
| apiVersion: v1 |
| kind: Pod |
| metadata: |
| name: {{ template "mysql.fullname" . }}-test |
| namespace: {{ .Release.Namespace }} |
| labels: |
| app: {{ template "mysql.fullname" . }} |
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| heritage: "{{ .Release.Service }}" |
| release: "{{ .Release.Name }}" |
| annotations: |
| "helm.sh/hook": test-success |
| spec: |
| {{- if .Values.testFramework.securityContext }} |
| securityContext: {{ toYaml .Values.testFramework.securityContext | nindent 4 }} |
| {{- end }} |
| {{- if .Values.imagePullSecrets }} |
| imagePullSecrets: |
| {{- range .Values.imagePullSecrets }} |
| - name: {{ . }} |
| {{- end}} |
| {{- end }} |
| {{- with .Values.nodeSelector }} |
| nodeSelector: |
| {{ toYaml . | indent 4 }} |
| {{- end }} |
| {{- with .Values.affinity }} |
| affinity: |
| {{ toYaml . | indent 4 }} |
| {{- end }} |
| {{- with .Values.tolerations }} |
| tolerations: |
| {{ toYaml . | indent 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 |
| {{- if .Values.ssl.enabled }} |
| - name: certificates |
| mountPath: /ssl |
| {{- end }} |
| volumes: |
| - name: tests |
| configMap: |
| name: {{ template "mysql.fullname" . }}-test |
| {{- if .Values.ssl.enabled }} |
| - name: certificates |
| secret: |
| secretName: {{ .Values.ssl.secret }} |
| {{- end }} |
| restartPolicy: Never |
| {{- end }} |