From 4a127db69886e26cc0965fd446d024ea587ca4fb Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 6 Dec 2025 11:46:52 -0800 Subject: [PATCH] helm: address review comments - Fix post-install-bucket-hook.yaml: add filer.s3.enableAuth and filer.s3.existingConfigSecret to or statements for consistency - Fix all-in-one-deployment.yaml: use default function for s3.domainName - Fix all-in-one-deployment.yaml: use hasKey function for s3.allowEmptyFolder --- .../all-in-one/all-in-one-deployment.yaml | 18 +++++++++--------- .../shared/post-install-bucket-hook.yaml | 4 ++-- 2 files changed, 11 insertions(+), 11 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 decc0bf39..59d25b770 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 @@ -234,10 +234,9 @@ spec: {{- if .Values.allInOne.s3.enabled }} -s3 \ -s3.port={{ .Values.allInOne.s3.port | default .Values.s3.port }} \ - {{- if .Values.allInOne.s3.domainName }} - -s3.domainName={{ .Values.allInOne.s3.domainName }} \ - {{- else if .Values.s3.domainName }} - -s3.domainName={{ .Values.s3.domainName }} \ + {{- $domainName := .Values.allInOne.s3.domainName | default .Values.s3.domainName }} + {{- if $domainName }} + -s3.domainName={{ $domainName }} \ {{- end }} {{- if .Values.global.enableSecurity }} {{- $httpsPort := .Values.allInOne.s3.httpsPort | default .Values.s3.httpsPort }} @@ -247,11 +246,12 @@ spec: -s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \ -s3.key.file=/usr/local/share/ca-certificates/client/tls.key \ {{- end }} - {{- $s3AllowEmptyFolder := .Values.allInOne.s3.allowEmptyFolder }} - {{- if eq (typeOf $s3AllowEmptyFolder) "bool" }} - -s3.allowEmptyFolder={{ $s3AllowEmptyFolder }} \ - {{- else if eq (typeOf .Values.s3.allowEmptyFolder) "bool" }} - -s3.allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \ + {{- $allowEmptyFolder := .Values.s3.allowEmptyFolder -}} + {{- if hasKey .Values.allInOne.s3 "allowEmptyFolder" -}} + {{- $allowEmptyFolder = .Values.allInOne.s3.allowEmptyFolder -}} + {{- end -}} + {{- if eq (typeOf $allowEmptyFolder) "bool" }} + -s3.allowEmptyFolder={{ $allowEmptyFolder }} \ {{- end }} {{- if or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }} -s3.config=/etc/sw/s3/seaweedfs_s3_config \ diff --git a/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml b/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml index ce7d61397..6952c4f6a 100644 --- a/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml +++ b/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml @@ -11,8 +11,8 @@ {{- if .Values.allInOne.s3.createBuckets }} {{- $createBuckets = .Values.allInOne.s3.createBuckets }} {{- end }} - {{- $enableAuth = or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth }} - {{- $existingConfigSecret = or .Values.allInOne.s3.existingConfigSecret .Values.s3.existingConfigSecret }} + {{- $enableAuth = or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }} + {{- $existingConfigSecret = or .Values.allInOne.s3.existingConfigSecret .Values.s3.existingConfigSecret .Values.filer.s3.existingConfigSecret }} {{- end }} {{- else if .Values.master.enabled }} {{- /* Check standalone filer.s3 mode */}}