Repository navigation
fix(seaweedfs): remove identities left behind by deleted BucketAccesses - #4915
Open
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
Open
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
Conversation
Since SeaweedFS 4.08 the S3 gateways move every identity from /etc/iam/identity.json into /etc/iam/identities/<name>.json, and the COSI driver up to v0.3.1 revokes only from identity.json. Every BucketAccess deleted on such a filer left its identity file behind, with its keys still accepted (seaweedfs/seaweedfs-cosi-driver#11). A driver that deletes the file on revoke does nothing for the files already left. A post-install/post-upgrade hook removes a ba-<uid>.json file when no BucketAccess in any namespace names it, by uid or by status.accountID, and the file has not changed for ten minutes. The uid covers a BucketAccess still being granted, the accountID one restored with its status, and the age a grant in flight. A failed or empty listing removes nothing. Each removal is logged and recorded as an Event on the HelmRelease. A filer published for Client-topology clusters holds identities whose BucketAccesses live in those clusters, so cosi.orphanIdentities defaults to auto: report there, delete otherwise. An operator can force either. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
Aleksei Sviridkin (lexfrei)
requested review from
Andrei Kvapil (kvaps),
Timofei Larkin (lllamnyp) and
myasnikovdaniil
as code owners
October 14, 2026 08:24
Aleksei Sviridkin (lexfrei)
requested review from
IvanHunters,
mattia-eleuteri and
Kirill Ilin (sircthulhu)
as code owners
October 14, 2026 08:24
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Removes SeaweedFS identities left behind by deleted BucketAccesses. The COSI driver up to v0.3.1 revokes only from the legacy
identity.json, while SeaweedFS since 4.08 keeps each identity in its own file, so those files stayed (seaweedfs/seaweedfs-cosi-driver#11). The driver built in #4893 deletes the file on revoke, but files already left behind stay until something removes them.A post-install/post-upgrade hook in
seaweedfs-systemremoves them. The rules for what it deletes are in the commit message and at the top of the script. When it is unsure, it removes nothing, and nothing it runs into fails the release.A filer that other clusters use through Client topology holds identities whose BucketAccesses this cluster cannot see. The new
cosi.orphanIdentitiesvalue of the SeaweedFS application decides what happens there. The defaultautoonly reports whenfiler.grpcHostis set and removes otherwise, and an operator can forcereportordelete.Stacked on #4893.
Tested with bats against a fake
weed shelland with helm-unittest, including mutations of every condition that guards a removal. On a live cluster with SeaweedFS 4.45 and driver v0.3.1, the hook skipped a fresh file, only reported in report mode, and removed left-over files in delete mode while live identities kept working. With BucketAccess listing forbidden, it removed nothing.Screenshots
Not a UI change.
Downstream repositories
The new value belongs to the SeaweedFS application, which the Terraform provider does not model (it only sets
seaweedfson a Tenant). The website reference page is regenerated from the README on release.Release note