longhorn: upgrade from 1.9.0 to 1.12.0 (with intermediate releases)
Change-Id: Ice8f4e8f7e073023ab274c83154d9368525f9231
diff --git a/charts/longhorn/templates/_helpers.tpl b/charts/longhorn/templates/_helpers.tpl
index 3fbc2ac..67afc97 100644
--- a/charts/longhorn/templates/_helpers.tpl
+++ b/charts/longhorn/templates/_helpers.tpl
@@ -40,15 +40,15 @@
{{- define "system_default_registry" -}}
{{- if .Values.global.cattle.systemDefaultRegistry -}}
-{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
+{{- .Values.global.cattle.systemDefaultRegistry -}}
{{- else -}}
-{{- "" -}}
+{{- "docker.io" -}}
{{- end -}}
{{- end -}}
{{- define "registry_url" -}}
{{- if .Values.privateRegistry.registryUrl -}}
-{{- printf "%s/" .Values.privateRegistry.registryUrl -}}
+{{- .Values.privateRegistry.registryUrl -}}
{{- else -}}
{{ include "system_default_registry" . }}
{{- end -}}
@@ -64,3 +64,28 @@
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
+
+{{- /*
+multiTypeSetting helper
+Input: any value (string, number, or map)
+Output: properly quoted YAML string
+*/ -}}
+{{- define "longhorn.multiTypeSetting" -}}
+ {{- $v := . -}}
+ {{- if kindIs "map" $v -}}
+ {{- $v | toJson | quote -}}
+ {{- else -}}
+ {{- $v | quote -}}
+ {{- end -}}
+{{- end -}}
+
+{{/*
+Optional timezone injection for all Longhorn workloads.
+When .Values.global.timezone is set, this snippet renders a TZ env var.
+*/}}
+{{- define "longhorn.timezoneEnv" -}}
+{{- if .Values.global.timezone }}
+- name: TZ
+ value: {{ .Values.global.timezone | quote }}
+{{- end }}
+{{- end -}}