You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.yaml 1.6 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {{- if .Values.testFramework.enabled }}
  2. apiVersion: v1
  3. kind: Pod
  4. metadata:
  5. name: {{ template "mysql.fullname" . }}-test
  6. namespace: {{ .Release.Namespace }}
  7. labels:
  8. app: {{ template "mysql.fullname" . }}
  9. chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
  10. heritage: "{{ .Release.Service }}"
  11. release: "{{ .Release.Name }}"
  12. annotations:
  13. "helm.sh/hook": test-success
  14. spec:
  15. {{- if .Values.testFramework.securityContext }}
  16. securityContext: {{ toYaml .Values.testFramework.securityContext | nindent 4 }}
  17. {{- end }}
  18. {{- if .Values.imagePullSecrets }}
  19. imagePullSecrets:
  20. {{- range .Values.imagePullSecrets }}
  21. - name: {{ . }}
  22. {{- end}}
  23. {{- end }}
  24. {{- with .Values.nodeSelector }}
  25. nodeSelector:
  26. {{ toYaml . | indent 4 }}
  27. {{- end }}
  28. {{- with .Values.affinity }}
  29. affinity:
  30. {{ toYaml . | indent 4 }}
  31. {{- end }}
  32. {{- with .Values.tolerations }}
  33. tolerations:
  34. {{ toYaml . | indent 4 }}
  35. {{- end }}
  36. containers:
  37. - name: {{ .Release.Name }}-test
  38. image: "{{ .Values.testFramework.image }}:{{ .Values.testFramework.tag }}"
  39. imagePullPolicy: "{{ .Values.testFramework.imagePullPolicy}}"
  40. command: ["/opt/bats/bin/bats", "-t", "/tests/run.sh"]
  41. volumeMounts:
  42. - mountPath: /tests
  43. name: tests
  44. readOnly: true
  45. {{- if .Values.ssl.enabled }}
  46. - name: certificates
  47. mountPath: /ssl
  48. {{- end }}
  49. volumes:
  50. - name: tests
  51. configMap:
  52. name: {{ template "mysql.fullname" . }}-test
  53. {{- if .Values.ssl.enabled }}
  54. - name: certificates
  55. secret:
  56. secretName: {{ .Values.ssl.secret }}
  57. {{- end }}
  58. restartPolicy: Never
  59. {{- end }}