{{- include "release.validateValues" . -}}

## To get the application URL, run:
{{- $ingressclass := index .Values "ingress" "annotations" "kubernetes.io/ingress.class" }}
{{- $ingressPath := .Values.ingress.path -}}
{{- if and .Values.ingress.Enabled }}
{{- if and (contains $ingressclass "nginx") (ne $ingressPath "/") }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ include "path.fullname" $ }}
{{- end }}
{{- else }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- end }}
{{- end }}

## To get the admin password for xl-release, run:
kubectl get secret --namespace {{ .Release.Namespace }} {{ include "xl-release.fullname" . }} -o jsonpath="{.data.release-password}" | base64 --decode; echo
{{ if .Values.postgresql.install }}
## To get the password for postgresql, run:
kubectl get secret --namespace  {{ .Release.Namespace }} {{ .Release.Name }}-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode; echo
{{ end }}
## To get the password for rabbitMQ, run:
{{- if .Values.rabbitmq.install }}
kubectl get secret --namespace  {{ .Release.Namespace }} {{ .Release.Name }}-rabbitmq   -o jsonpath="{.data.rabbitmq-password}" | base64 --decode; echo
{{- else }}
kubectl get secret --namespace {{ .Release.Namespace }} {{ include "xl-release.fullname" . }} -o jsonpath="{.data.rabbitmqPassword}" | base64 --decode; echo
{{- end }}
