{{- if .Values.initContainers }}
#############################################################################
##                             *** WARNING ***                             ##
##                                                                         ##
##  The 'initContainers' parameter is DEPRECATED!                          ##
##  Please migrate to 'extraInitContainers' instead.                       ##
##                                                                         ##
##  Support for 'initContainers' will be removed after 2030.               ##
##                                                                         ##
##  Migration guide:                                                       ##
##    Old: initContainers: [...]                                           ##
##    New: extraInitContainers: [...]                                      ##
##                                                                         ##
#############################################################################

{{- end }}
{{- if and .Values.networkPolicy.enabled (or .Values.jellyfin.enableDLNA .Values.podPrivileges.hostNetwork) }}
#############################################################################
##                              *** ERROR ***                              ##
##                                                                         ##
##  NetworkPolicy cannot be enabled with hostNetwork or DLNA!              ##
##                                                                         ##
##  The deployment will FAIL. Please fix your configuration:               ##
##    - Disable networkPolicy.enabled, OR                                  ##
##    - Disable jellyfin.enableDLNA and podPrivileges.hostNetwork          ##
##                                                                         ##
#############################################################################

{{- end }}
Thank you for installing {{ .Chart.Name }}!

Your release is named {{ .Release.Name }}.

{{- if .Values.ingress.enabled }}

Jellyfin is available via Ingress at:
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }}
{{- end }}
{{- else if .Values.httpRoute.enabled }}

Jellyfin is available via Gateway API HTTPRoute.
{{- if .Values.httpRoute.hostnames }}
Hostnames configured:
{{- range .Values.httpRoute.hostnames }}
- {{ . }}
{{- end }}
{{- else }}
⚠ No hostnames configured. Set httpRoute.hostnames for external access.
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}

Get the Jellyfin URL by running:

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "jellyfin.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "Jellyfin URL: http://$NODE_IP:$NODE_PORT"
{{- else if contains "LoadBalancer" .Values.service.type }}

Get the Jellyfin URL by running:

NOTE: It may take a few minutes for the LoadBalancer IP to be available.

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "jellyfin.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo "Jellyfin URL: http://$SERVICE_IP:{{ .Values.service.port }}"
{{- else }}

To access Jellyfin, use port-forwarding:

kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "jellyfin.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }}

Then visit http://localhost:{{ .Values.service.port }} in your browser.
{{- end }}

{{- if not .Values.persistence.config.enabled }}

⚠ WARNING: Configuration persistence is disabled. Data will be lost on pod restart.
{{- end }}
{{- if not .Values.persistence.media.enabled }}

⚠ WARNING: Media persistence is disabled. Media files will be lost on pod restart.
{{- end }}

For more information:
Chart documentation: https://github.com/jellyfin/jellyfin-helm
Jellyfin docs: https://jellyfin.org/docs/
Get release info: helm status {{ .Release.Name }} -n {{ .Release.Namespace }}
