From 05af6c86e86e424cec906356ad37bf7f8c37e5ce Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 6 Dec 2025 12:24:33 -0800 Subject: [PATCH] helm: simplify allowEmptyFolder logic using coalesce Use coalesce function for cleaner template code as suggested in review. --- .../templates/all-in-one/all-in-one-deployment.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 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 59d25b770..bb72f8772 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 @@ -246,10 +246,7 @@ spec: -s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \ -s3.key.file=/usr/local/share/ca-certificates/client/tls.key \ {{- end }} - {{- $allowEmptyFolder := .Values.s3.allowEmptyFolder -}} - {{- if hasKey .Values.allInOne.s3 "allowEmptyFolder" -}} - {{- $allowEmptyFolder = .Values.allInOne.s3.allowEmptyFolder -}} - {{- end -}} + {{- $allowEmptyFolder := coalesce .Values.allInOne.s3.allowEmptyFolder .Values.s3.allowEmptyFolder -}} {{- if eq (typeOf $allowEmptyFolder) "bool" }} -s3.allowEmptyFolder={{ $allowEmptyFolder }} \ {{- end }}