---
apiVersion: v1
kind: Pod
metadata:
  name: "{{ .Release.Name }}-{{ randAlpha 5 | lower }}-test"
  annotations:
    "helm.sh/hook": test-success
spec:
  containers:
  - name: "{{ .Release.Name }}-{{ randAlpha 5 | lower }}-test"
    image: "{{ .Values.image }}:{{ .Values.imageTag }}"
    command:
      - "sh"
      - "-c"
      - |
        #!/usr/bin/env bash -e
        curl -XGET --fail '{{ template "uname" . }}:{{ .Values.httpPort }}/_cluster/health?wait_for_status=green&timeout=1s'
  restartPolicy: Never
