Browse Source

helm: simplify allowEmptyFolder logic using coalesce

Use coalesce function for cleaner template code as suggested in review.
pull/7639/head
chrislu 1 month ago
parent
commit
05af6c86e8
  1. 5
      k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml

5
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 }}

Loading…
Cancel
Save