| {{- if .Values.tests.enabled }} |
| {{- $root := . }} |
| apiVersion: v1 |
| kind: Pod |
| metadata: |
| name: {{ include "dubbo-admin.fullname" . }}-test |
| labels: |
| {{- include "dubbo-admin.labels" . | nindent 4 }} |
| annotations: |
| "helm.sh/hook": test-success |
| "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded" |
| namespace: {{ include "dubbo-admin.namespace" . }} |
| spec: |
| serviceAccountName: {{ include "dubbo-admin.serviceAccountName" . }} |
| {{- with .Values.tests.securityContext }} |
| securityContext: |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| {{- if or .Values.image.pullSecrets .Values.global.imagePullSecrets }} |
| imagePullSecrets: |
| {{- include "dubbo-admin.imagePullSecrets" (dict "root" $root "imagePullSecrets" .Values.image.pullSecrets) | nindent 4 }} |
| {{- end }} |
| {{- with .Values.nodeSelector }} |
| nodeSelector: |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| {{- with .Values.affinity }} |
| affinity: |
| {{- tpl (toYaml .) $root | nindent 4 }} |
| {{- end }} |
| {{- with .Values.tolerations }} |
| tolerations: |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| containers: |
| - name: {{ .Release.Name }}-test |
| image: "{{ .Values.tests.image}}" |
| imagePullPolicy: "{{ .Values.tests.imagePullPolicy}}" |
| command: ["wget"] |
| volumeMounts: |
| - mountPath: /tests |
| name: tests |
| readOnly: true |
| volumes: |
| - name: tests |
| secret: |
| secretName: {{ include "dubbo-admin.fullname" . }}-secret |
| restartPolicy: Never |
| {{- end }} |