Skip to content

Commit 76a34d3

Browse files
fix(seaweedfs): bump the COSI driver to v0.4.0 for the lost-grant fix (cozystack#5284)
## What this PR does This PR bumps seaweedfs COSI driver to v0.4.0, because v0.3.1 can lose a grant for good: BucketAccess reports `accessGranted` and its Secret is written, but S3 gateways keep rejecting the key with `InvalidAccessKeyId`. Fixes cozystack#4912. Driver v0.3.1 grants access by rewriting legacy `/etc/iam/identity.json`, and every S3 gateway migrates this file to per-identity files and renames it away on each change, so grant written during migration is dropped. v0.4.0 also writes `/etc/iam/identities/<user>.json` on grant (seaweedfs/seaweedfs-cosi-driver#15). First version of this PR built the driver from that upstream commit, now upstream released v0.4.0 so it's just a tag bump. Rest of v0.4.0 doesn't reach the platform: - `readwrite-governance-bypass` access policy (seaweedfs/seaweedfs-cosi-driver#16) is opt-in, none of our BucketAccessClasses use it. - Bucket deletion is refused while objects hold an active lock (seaweedfs/seaweedfs-cosi-driver#18), only for object-lock buckets. All `-lock` BucketClasses are `Retain`, and sidecar calls DriverDeleteBucket only for `Delete`. - Filer errors (seaweedfs/seaweedfs-cosi-driver#20) are now matched by exact not-found message, I checked it against seaweedfs 4.45 filer and formats match. One behavior change: bucket deletion doesn't ignore errors of the recursive delete anymore, so sidecar retries instead of reporting success. How I tested (seaweedfs 4.45, two S3 gateways): Bucket with one user, then three more users added in one change, after a minute ListObjects with each user key, rejected key retried once more after 30s. Five runs for each driver, the fixed one is a build of `5efd120`, the commit v0.4.0 takes the grant fix from: | driver | keys rejected for good | | --- | --- | | v0.3.1 | 5 of 20 (4 runs out of 5 lost at least one) | | `5efd120` | 0 of 20 | Same failure broke v1.7.1-rc.1 e2e, RabbitMQ backup round-trip got `403 InvalidAccessKeyId` for freshly granted key: https://github.com/cozystack/cozystack/actions/runs/42980741995 Keys already lost on running clusters stay broken after upgrade. Workaround from cozystack#4912 still works: remove user from Bucket, wait until its BucketAccess is gone, add it back. ### Screenshots Not a UI change. ### Downstream repositories - [x] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: ### Release note ```release-note fix(seaweedfs): bucket users granted together could get S3 keys that never work (403 InvalidAccessKeyId). COSI driver is bumped to v0.4.0, which writes each grant to per-identity IAM file. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Updates** * Updated the SeaweedFS COSI driver to version `v0.4.0`. * The updated driver writes IAM files per identity, helping preserve grants when identity files are updated. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 0b284a6 + 6a93765 commit 76a34d3

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.3.1
1+
ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.4.0

‎packages/system/seaweedfs/tests/cosi_image_test.yaml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ suite: seaweedfs COSI driver image pin
77
# BucketAccess and ignores the accessPolicy parameter. The chart ships a
88
# -readonly BucketAccessClass with parameters.accessPolicy: readonly, so on
99
# v0.1.2 a credential meant to be read-only is silently granted read-write.
10-
# The package values.yaml overrides cosi.image to v0.3.1, which honours
10+
# The package values.yaml overrides cosi.image to v0.4.0, which honours
1111
# accessPolicy: readonly.
1212
#
1313
# This test does not set the image itself; it relies on the package values.yaml
@@ -25,7 +25,7 @@ release:
2525
namespace: cozy-seaweedfs
2626

2727
tests:
28-
- it: pins the cosi-driver container to v0.3.1 (read-only access enforcement)
28+
- it: pins the cosi-driver container to v0.4.0 (read-only access enforcement)
2929
template: charts/seaweedfs/templates/cosi/cosi-deployment.yaml
3030
set:
3131
seaweedfs.cosi.enabled: true
@@ -35,4 +35,4 @@ tests:
3535
value: seaweedfs-cosi-driver
3636
- equal:
3737
path: spec.template.spec.containers[0].image
38-
value: ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.3.1
38+
value: ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.4.0

‎packages/system/seaweedfs/values.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ seaweedfs:
303303
# S3 actions for every BucketAccess and ignores the accessPolicy parameter.
304304
# v0.3.x honours accessPolicy: readonly, so a -readonly BucketAccessClass
305305
# actually issues read-only (Read,List) credentials instead of read-write.
306-
image: "ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.3.1"
306+
# v0.4.0 also writes each grant to the per-identity IAM file: v0.3.1
307+
# rewrites only the legacy identity.json, which the S3 gateways migrate
308+
# concurrently, so a grant could be lost for good.
309+
image: "ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.4.0"
307310
podLabels:
308311
policy.cozystack.io/allow-to-apiserver: "true"
309312
driverName: "seaweedfs.objectstorage.k8s.io"

0 commit comments

Comments
 (0)