github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/helm2-dependency/templates/tests/test-mariadb-connection.yaml (about)

     1  {{- if .Values.mariadb.enabled }}
     2  apiVersion: v1
     3  kind: Pod
     4  metadata:
     5    name: "{{ .Release.Name }}-credentials-test"
     6    annotations:
     7      "helm.sh/hook": test-success
     8  spec:
     9    containers:
    10    - name: {{ .Release.Name }}-credentials-test
    11      image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
    12      imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
    13      env:
    14        - name: MARIADB_HOST
    15          value: {{ template "mariadb.fullname" . }}
    16        - name: MARIADB_PORT
    17          value: "3306"
    18        - name: WORDPRESS_DATABASE_NAME
    19          value: {{ default "" .Values.mariadb.db.name | quote }}
    20        - name: WORDPRESS_DATABASE_USER
    21          value: {{ default "" .Values.mariadb.db.user | quote }}
    22        - name: WORDPRESS_DATABASE_PASSWORD
    23          valueFrom:
    24            secretKeyRef:
    25              name: {{ template "mariadb.fullname" . }}
    26              key: mariadb-password
    27      command: ["sh", "-c", "mysql --host=$MARIADB_HOST --port=$MARIADB_PORT --user=$WORDPRESS_DATABASE_USER --password=$WORDPRESS_DATABASE_PASSWORD"]
    28    restartPolicy: Never
    29  {{- end }}