apiVersion: v1
kind: Pod
metadata:
  name: {{ template "redis-ha.fullname" . }}-sentinel-service-test
  labels:
{{ include "labels.standard" . | indent 4 }}
  annotations:
    "helm.sh/hook": test-success
spec:
  containers:
  - name: "{{ .Release.Name }}-sentinel-service-test"
    image: {{ .Values.redis_image }}
    env:
      - name: REDIS_CHART_PREFIX
        value: {{ template "redis-ha.fullname" . }}-
{{- if .Values.auth }}
      - name: REDIS_PASS
        valueFrom:
          secretKeyRef:
            name: {{ template "redis-ha.fullname" . }}
            key: auth
    command:
      - sh
      - -c
      - redis-cli -a $REDIS_PASS -h ${REDIS_CHART_PREFIX}sentinel -p 26379 info server
{{- else }}
    command:
      - sh
      - -c
      - redis-cli -h ${REDIS_CHART_PREFIX}sentinel -p 26379 info server
{{- end }}
  restartPolicy: Never
