apiVersion: v1
kind: Secret
metadata:
  name: logger-redis-creds
  labels:
    app: deis-logger-redis
    heritage: deis
  annotations:
    "helm.sh/hook": pre-install
data: {{ if eq .Values.global.logger_redis_location "on-cluster"}}
  password: {{ randAlphaNum 32 | b64enc }}{{ else if eq .Values.global.logger_redis_location "off-cluster"}}
  db: {{ .Values.postgres.db | b64enc }}
  password: {{ .Values.password | b64enc }}
  host: {{ .Values.postgres.host | b64enc }}
  port: {{ .Values.postgres.port | b64enc }}{{ end }}
