Merge pull request #251 from zadjadr/patch-1

This commit is contained in:
James W. 2025-06-10 18:06:06 -06:00 committed by GitHub
commit 9ea553bb62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 7 deletions

View File

@ -239,9 +239,18 @@ Constructs a string containing the URLs of the Open WebUI based on the ingress c
used to populate the variable WEBUI_URL
*/ -}}
{{- define "openweb-ui.url" -}}
{{- $proto := "http" -}}
{{- if .Values.ingress.tls -}}
{{- $proto = "https" -}}
{{- end -}}
{{- printf "%s://%s" $proto $.Values.ingress.host }}
{{- $url := "" -}}
{{- range .Values.extraEnvVars }}
{{- if and (eq .name "WEBUI_URL") .value }}
{{- $url = .value }}
{{- end }}
{{- end }}
{{- if not $url }}
{{- $proto := "http" -}}
{{- if .Values.ingress.tls }}
{{- $proto = "https" -}}
{{- end }}
{{- $url = printf "%s://%s" $proto .Values.ingress.host }}
{{- end }}
{{- $url }}
{{- end }}

View File

@ -119,9 +119,15 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
env:
{{- if .Values.ingress.enabled }}
{{- $hasCustomWebUIUrl := false }}
{{- range .Values.extraEnvVars }}
{{- if eq .name "WEBUI_URL" }}
{{- $hasCustomWebUIUrl = true }}
{{- end }}
{{- end }}
{{- if and .Values.ingress.enabled (not $hasCustomWebUIUrl) }}
- name: WEBUI_URL
value: {{ include "openweb-ui.url" . }}
value: {{ include "openweb-ui.url" . | quote }}
{{- end }}
{{- if .Values.ollamaUrlsFromExtraEnv}}
{{- else if or .Values.ollamaUrls .Values.ollama.enabled }}