fix(seaweedfs): restore S3 TLS and COSI provisioner SA after 4.31 bump - #2916
Conversation
The 4.31 chart bump (#2834) broke E2E for every PR: tenant-root seaweedfs-system never becomes ready. 1. S3 served plaintext. Until 4.05 the -cert.file/-key.file args were rendered whenever enableSecurity was set, so weed s3 served TLS on the main port (8333); 4.31 nested them under 'if s3.httpsPort' and we ship httpsPort=0, so s3 spoke HTTP while the HTTPS probes, the ingress backend-protocol and the COSI sidecar endpoint all expected HTTPS ('server gave HTTP response to HTTPS client'). Restore the 4.05 behaviour via patch. 2. COSI provisioner ServiceAccount mismatch. cosi-service-account.yaml and the ClusterRoleBinding name the SA <serviceAccountName>-objectstorage-provisioner, but the Deployment referenced componentName (<release>-objectstorage-provisioner). When serviceAccountName != release name (tenant-root-seaweedfs vs seaweedfs-system) the Deployment could not create pods ('serviceaccount not found'). Align the Deployment with the SA + binding. Both fixes are vendored as patches re-applied by 'make update', and covered by helm-unittest. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <andrei.kvapil@aenix.io>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses two regressions introduced by the SeaweedFS 4.31 chart bump that were causing deployment failures in the system. By applying vendored patches and adding unit tests, the changes restore necessary TLS configurations for S3 and correct a ServiceAccount mismatch in the COSI provisioner, ensuring the SeaweedFS release becomes ready as expected. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
📝 WalkthroughWalkthroughTwo Helm template bug fixes for the SeaweedFS chart: the S3 deployment template now emits TLS cert/key arguments independently of whether ChangesSeaweedFS Helm chart bug fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the SeaweedFS package Makefile to apply two new patches: s3-tls-main-port.patch and cosi-provisioner-sa-name.patch. It also introduces a new test suite (s3_tls_cosi_sa_test.yaml) to verify S3 TLS behavior on the main port and ensure the COSI provisioner deployment correctly uses the service-account-name-based ServiceAccount. I have no feedback to provide as the changes are well-implemented and include appropriate tests.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/system/seaweedfs/patches/cosi-provisioner-sa-name.patch`:
- Around line 9-10: The patch removes the seaweedfs.componentName helper
function which provides critical default fallback behavior for
serviceAccountName. When global.seaweedfs.serviceAccountName is unset or empty,
the resulting name becomes invalid, preventing pod scheduling. Restore the use
of the seaweedfs.componentName helper function in the serviceAccountName
assignment on line 10 while still incorporating the value-driven naming from
global.seaweedfs.serviceAccountName, ensuring the chart's defaulting contract is
preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8c055c28-3f66-4aa2-907e-ecec2e882ccf
📒 Files selected for processing (6)
packages/system/seaweedfs/Makefilepackages/system/seaweedfs/charts/seaweedfs/templates/cosi/cosi-deployment.yamlpackages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-deployment.yamlpackages/system/seaweedfs/patches/cosi-provisioner-sa-name.patchpackages/system/seaweedfs/patches/s3-tls-main-port.patchpackages/system/seaweedfs/tests/s3_tls_cosi_sa_test.yaml
| - serviceAccountName: {{ include "seaweedfs.componentName" (list . "objectstorage-provisioner") }} | ||
| + serviceAccountName: {{ .Values.global.seaweedfs.serviceAccountName }}-objectstorage-provisioner |
There was a problem hiding this comment.
ServiceAccount naming loses helper fallback default
At Line 10, serviceAccountName is built from a raw value. If global.seaweedfs.serviceAccountName is unset/empty, the rendered SA name can become invalid/unexpected and the Deployment won’t schedule pods. Keep the value-driven naming, but preserve the chart’s defaulting contract via the helper.
Suggested fix
- serviceAccountName: {{ .Values.global.seaweedfs.serviceAccountName }}-objectstorage-provisioner
+ serviceAccountName: {{ include "seaweedfs.serviceAccountName" . }}-objectstorage-provisioner🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/system/seaweedfs/patches/cosi-provisioner-sa-name.patch` around
lines 9 - 10, The patch removes the seaweedfs.componentName helper function
which provides critical default fallback behavior for serviceAccountName. When
global.seaweedfs.serviceAccountName is unset or empty, the resulting name
becomes invalid, preventing pod scheduling. Restore the use of the
seaweedfs.componentName helper function in the serviceAccountName assignment on
line 10 while still incorporating the value-driven naming from
global.seaweedfs.serviceAccountName, ensuring the chart's defaulting contract is
preserved.
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
LGTM — both regressions are real, the patches are minimal and consistent with the chart's existing naming, and the new helm-unittest coverage fails without the fix.
Business context: The SeaweedFS 4.31 chart bump broke E2E on main for every PR (seaweedfs-system never becomes ready); this restores S3 TLS on the main port and fixes the COSI provisioner ServiceAccount reference so the release reconciles again.
Verified the mechanism end to end:
- S3 TLS — with
enableSecurity: true+httpsPort: 0the pre-4.31 logic rendered-cert.file/-key.fileon the main port; 4.31 gated them behindif .Values.s3.httpsPort, so s3 served plaintext while the readiness/liveness probes hits3.portwithscheme: HTTPS. Moving thetlsArgsinclude out of thehttpsPortgate (still underenableSecurity) restores TLS on the main port;-port.httpsstays gated onhttpsPort. - COSI SA —
cosi-service-account.yamland the ClusterRoleBinding subject both name the SA{{ .Values.global.seaweedfs.serviceAccountName }}-objectstorage-provisioner(raw value, no default), while the Deployment referencedseaweedfs.componentName(release-based). WithserviceAccountName!= release name the Deployment pointed at a non-existent SA. The patch aligns the Deployment with the SA object and the binding. - The new tests are non-vacuous: reverting both rendered templates to the base version fails both cases (
-key.filemissing; serviceAccountName rendersseaweedfs-objectstorage-provisionerinstead of the value-based name).
On the inline bot suggestion (cosi-provisioner-sa-name.patch): switching the Deployment to include "seaweedfs.serviceAccountName" . is not correct here. That helper defaults to "seaweedfs", but the SA object and the ClusterRoleBinding subject use the raw .Values.global.seaweedfs.serviceAccountName with no default. Routing only the Deployment through the helper would re-introduce a mismatch whenever serviceAccountName is empty (Deployment -> seaweedfs-..., SA object -> -...). The raw-value form is the consistent fix.
Non-blocking follow-ups
- Both are upstream chart issues (httpsPort-gated TLS args; Deployment using
componentNamewhile the SA and binding use the value). Worth an upstream PR so these vendored patches can eventually drop — the downstream copies are a fine interim.
What this PR does
The SeaweedFS 4.31 chart bump (#2834) broke E2E for every PR on
main: intenant-roottheseaweedfs-systemrelease never becomes ready, soinstall-cozystacktimes out waiting on its HelmRelease. Two regressions came in with the new chart; both reproduce with a plainhelm templateofpackages/system/seaweedfs(no cluster needed) and are fixed here as vendored patches re-applied bymake update, with helm-unittest coverage.1. S3 served plaintext while everything expected HTTPS. Until chart 4.05 the
-cert.file/-key.fileargs were rendered wheneverenableSecuritywas set, soweed s3served TLS on the main port (8333). Chart 4.31 nested those args inside{{- if .Values.s3.httpsPort }}, and we shiphttpsPort: 0— so no TLS args rendered, s3 spoke HTTP, and the HTTPS readiness/liveness probes (plus the ingressbackend-protocol: HTTPSand the COSI sidecar'shttps://endpoint) all failed withserver gave HTTP response to HTTPS client.patches/s3-tls-main-port.patchmoves the cert/key args back out of thehttpsPortgate, restoring TLS-on-main-port;-port.httpsis still only added whenhttpsPortis set.2. COSI provisioner ServiceAccount name mismatch.
cosi-service-account.yamland theClusterRoleBindingname the SA<global.seaweedfs.serviceAccountName>-objectstorage-provisioner, but the Deployment referencedcomponentName(<release>-objectstorage-provisioner). WheneverserviceAccountName!= release name — our case,tenant-root-seaweedfsvsseaweedfs-system— the Deployment could not create pods (serviceaccount "seaweedfs-system-objectstorage-provisioner" not found).patches/cosi-provisioner-sa-name.patchaligns the Deployment with the SA and the binding. (Upstream installs only avoid this because their release name and serviceAccountName usually coincide.)This is
main-only: the 4.31 chart landed only onmain, every release branch is still on 4.05, so nobackportis needed.Release note
Summary by CodeRabbit
Bug Fixes
Tests