Files
truecharts/charts/stable/plex/templates/common.yaml
T
Stavros KoisandGitHub 7a0582895a fix(plex): When ClusterIP, only advertise ingress host if any (#4412)
* fix(plex): When ClusterIP, only advertise ingress host if any

* also append additional urls

* clean
2022-11-14 21:08:58 +01:00

44 lines
1.3 KiB
YAML

{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{- $adv := list -}}
{{- $serverURL := "" }}
{{- if not (eq .Values.service.main.type "ClusterIP") }}
{{- $serverURL = (printf "%v://%v:%v" (.Values.service.main.ports.main.protocol | lower) .Values.plex.serverIP .Values.service.main.ports.main.port) }}
{{- end }}
{{- $serverIngressURL := "" }}
{{- $host := "" }}
{{- if .Values.ingress.main.enabled }}
{{- with (first .Values.ingress.main.hosts) }}
{{- $host = .host }}
{{- $serverIngressURL = (printf "https://%v" .host) }}
{{- end }}
{{- end }}
{{- $serverIngressURLPort := "" }}
{{- if $host }}
{{- if not (eq .Values.service.main.type "ClusterIP") }}
{{- $port := .Values.service.main.ports.main.port }}
{{- $serverIngressURLPort = printf "https://%v:%v" $host $port }}
{{- end }}
{{- end }}
{{- with $serverURL }}
{{- $adv = append $adv . -}}
{{- end }}
{{- with $serverIngressURL }}
{{- $adv = append $adv . -}}
{{- end }}
{{- with $serverIngressURLPort }}
{{- $adv = append $adv . -}}
{{- end }}
{{- with .Values.plex.additionalAdvertiseURL }}
{{- $adv = append $adv . -}}
{{- end }}
{{- $_ := set .Values.env "ADVERTISE_IP" (join "," $adv) }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}