From efe722c18c21e5db4e56054837cead68313e6abe Mon Sep 17 00:00:00 2001 From: hoppla20 Date: Wed, 18 Mar 2026 20:19:46 +0100 Subject: [PATCH] fix(chart): all in one maxVolumes value (#8683) * fix(chart): all-in-one deployment maxVolumes value * chore(chart): improve readability * fix(chart): maxVolume nil value check * fix(chart): guard against nil/empty volume.dataDirs before calling first Without this check, `first` errors when volume.dataDirs is nil or empty, causing a template render failure for users who omit the setting entirely. --------- Co-authored-by: Copilot --- .../templates/all-in-one/all-in-one-deployment.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml b/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml index 187df65bd..5a833eb3d 100644 --- a/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml @@ -168,8 +168,12 @@ spec: {{- if .Values.allInOne.disableHttp }} -disableHttp={{ .Values.allInOne.disableHttp }} \ {{- end }} - {{- if and (.Values.volume.dataDirs) (index .Values.volume.dataDirs 0 "maxVolumes") }} - -volume.max={{ index .Values.volume.dataDirs 0 "maxVolumes" }} \ + {{- if .Values.volume.dataDirs }} + {{- with (first .Values.volume.dataDirs) }} + {{- if and (hasKey . "maxVolumes") (ne .maxVolumes nil) }} + -volume.max={{ .maxVolumes }} \ + {{- end }} + {{- end }} {{- end }} -master.port={{ .Values.master.port }} \ {{- if .Values.global.enableReplication }}