From ae4ad6859d8ce57f30904f683f9a1ce283ca02d8 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin <3811295@gmail.com> Date: Sat, 6 Jun 2026 01:18:10 +0300 Subject: [PATCH] fix(helm): suspend bucket versioning for YAML bool false (#9836) * fix(helm): suspend bucket versioning for YAML bool false createBuckets[].versioning accepts both a YAML bool and a string. The string branch maps "false"/"disable"/"suspended" to Suspended, but the bool branch only handled true (Enabled) and left false as a silent no-op. The same logical value therefore behaved differently depending on its YAML type: `versioning: false` did nothing while `versioning: "false"` suspended the bucket. Mirror the string behaviour in the bool branch so bool false suspends the bucket, and add a chart-CI render assertion covering it. Assisted-By: Claude Signed-off-by: Aleksei Sviridkin * ci(helm): trim versioning regression-test comment * chart: document bool false for createBuckets versioning --------- Signed-off-by: Aleksei Sviridkin Co-authored-by: Chris Lu --- .github/workflows/helm_ci.yml | 10 ++++++++++ .../templates/shared/post-install-bucket-hook.yaml | 2 ++ k8s/charts/seaweedfs/values.yaml | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm_ci.yml b/.github/workflows/helm_ci.yml index 60001a6d1..ae79ba392 100644 --- a/.github/workflows/helm_ci.yml +++ b/.github/workflows/helm_ci.yml @@ -446,6 +446,16 @@ jobs: sys.exit(1 if failed else 0) PYEOF + echo "" + echo "=== Testing bucket versioning: YAML bool false suspends like string \"false\" ===" + # bool false used to be a silent no-op while string "false" suspended. + BOOL_FALSE=$(helm template test $CHART_DIR \ + --set s3.enabled=true \ + --set s3.createBuckets[0].name=verbucket \ + --set s3.createBuckets[0].versioning=false | grep 's3.bucket.versioning -name verbucket' || true) + echo "$BOOL_FALSE" | grep -q -- '-status Suspended' || { echo "FAIL: bool false versioning did not Suspend the bucket"; exit 1; } + echo "✓ Bucket versioning: YAML bool false suspends consistently with string \"false\"" + echo "✅ All template rendering tests passed!" - name: Create kind cluster 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 9c4069845..2e780595f 100644 --- a/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml +++ b/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml @@ -143,6 +143,8 @@ spec: {{- if kindIs "bool" .versioning }} {{- if .versioning }} {{- $bucketVersioning = "Enabled" }} + {{- else }} + {{- $bucketVersioning = "Suspended" }} {{- end }} {{- else if kindIs "string" .versioning }} {{- $versioningLower := lower .versioning }} diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index e2f83384e..07b87fb0e 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -919,7 +919,7 @@ filer: # Buckets may be exposed publicly by setting `anonymousRead` to `true` # ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d) # objectLock enables S3 Object Lock (irreversible, forces versioning) - # versioning: Enabled or Suspended (or true to enable) + # versioning: Enabled or Suspended (or bool true/false) # createBuckets: # - name: bucket-a # anonymousRead: true @@ -972,7 +972,7 @@ s3: # Buckets may be exposed publicly by setting `anonymousRead` to `true` # ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d) # objectLock enables S3 Object Lock (irreversible, forces versioning) - # versioning: Enabled or Suspended (or true to enable) + # versioning: Enabled or Suspended (or bool true/false) # createBuckets: # - name: bucket-a # anonymousRead: true @@ -1526,7 +1526,7 @@ allInOne: # Buckets may be exposed publicly by setting `anonymousRead` to `true` # ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d) # objectLock enables S3 Object Lock (irreversible, forces versioning) - # versioning: Enabled or Suspended (or true to enable) + # versioning: Enabled or Suspended (or bool true/false) # createBuckets: # - name: bucket-a # anonymousRead: true