Existence checks depend on MinIO error codes; decide policy/user existence from list calls instead
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Start in internal/s3/client/impl/minioS3Client.go at GetPolicyInfo, UserExist, and DeleteUser, then read the surrounding MinIO client methods and their callers. Trace the list operations proposed for policies and users, preserving list errors, and verify that missing objects can be created or treated as already deleted without relying on MinIO-specific error codes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The MinIO client decides whether a policy or user exists by matching MinIO-specific error codes. Any backend that implements the MinIO admin API but reports "not found" differently can never get a Policy or S3User created. Its CRs are requeued indefinitely.
We hit this with RustFS (s3Provider: minio): Bucket CRs reconcile, Policy and S3User never do. The root cause is not RustFS-specific. The client depends on error nomenclature, as the code comment itself notes: "Not ideal (breaks if error nomenclature changes)".
Why this matters now: MinIO community edition is no longer maintained
minio/minio,minio/mcandminio/operatorare archived on GitHub. Theminio/minioREADME states "THIS REPOSITORY IS NO LONGER MAINTAINED" and points to the proprietary AIStor editions.- The images are gone from Docker Hub (
minio/minio→ 404), andquay.io/minio/minionow requires authentication (401). - The last public server image is
RELEASE.2025-09-07T16-13-09Z. The fix for CVE-2025-62506 (RELEASE.2025-10-15T17-29-55Z) exists only as source.
Many s3-operator users will move off MinIO to other self-hosted S3 servers. Where the new server implements the MinIO admin API (RustFS does), they can keep s3Provider: minio, but only if the client stops relying on MinIO's exact error nomenclature. Making the existence checks backend-neutral keeps the minio provider useful after MinIO itself is gone.
Where
internal/s3/client/impl/minioS3Client.go (commit 54d5781):
GetPolicyInfo(L341):madmin.ToErrorResponse(err).Code == "XMinioAdminNoSuchPolicy"UserExist(L425) andDeleteUser(L440):... == "XMinioAdminNoSuchUser"
With madmin-go/v4 the HTTP status is not kept in ErrorResponse, so status-based detection isn't an option either.
What a missing object returns (measured with madmin-go/v4 v4.10.0, the version in go.mod):
| Call on a missing object | MinIO RELEASE.2025-09-07 | RustFS 1.0.0 |
|---|---|---|
InfoCannedPolicy |
404 XMinioAdminNoSuchPolicy |
500 InternalError "policy does not exist" |
GetUserInfo |
404 XMinioAdminNoSuchUser |
404 NoSuchResource |
RemoveUser |
404 XMinioAdminNoSuchUser |
500 InternalError "…user '…' does not exist" |
The two RustFS 500s are reported upstream in https://github.com/rustfs/rustfs/issues/8117. Even once they are fixed, RustFS's not-found code is NoSuchResource, not XMinioAdmin*.
Proposal: decide existence from list calls, not from error codes (happy to send a PR)
PolicyExist(name)→ListCannedPolicies()and look upname. CallInfoCannedPolicyonly for policies known to exist.UserExist(accessKey)→ListUsers()and look upaccessKey.DeleteUser(accessKey)→ remove only if the user is listed; otherwise treat it as already deleted.- Any error from the list calls themselves stays a real error.
This removes the dependency on error nomenclature entirely. I checked the same sequence on both backends with madmin-go/v4 v4.10.0:
- list (absent) → add → list (present) → info → remove → list (absent)
Both ListCannedPolicies and ListUsers reflect creation and removal immediately, on MinIO and on RustFS 1.0.0. This works on RustFS today, including the 500 cases above.
The cost is one list call per reconcile of a Policy / S3User. That is fine for the usual number of identities per instance. A short-lived cache could be added later if needed.
The current code-based checks could stay as a fast path where the code is recognised, with the list call as the fallback. The list is the source of truth either way.
Reproduce
- Deploy RustFS 1.0.0.
- Create an
S3Instancewiths3Provider: miniopointing at it. - Apply a
Policyand anS3User. - The operator logs
an error occurred while checking policy existence/an error occurred when checking user's existence, and requeues indefinitely.
A policy created by hand beforehand does reconcile, and the operator updates it. Only creation (and user deletion) is blocked.
Environment
inseefrlab/s3-operator:v0.12.0(code atmain54d5781has the same checks)- RustFS
rustfs/rustfs:1.0.0, on k3d (k3s v1.30); MinIORELEASE.2025-09-07T16-13-09Zfor comparison
- Ngôn ngữ chính
- Go
- Star
- 66
- Fork
- 16
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InseeFrLab/s3-operator
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 65/100
InseeFrLab/s3-operator#145 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
InseeFrLab/s3-operator#136 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
InseeFrLab/s3-operator#135 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
InseeFrLab/s3-operator#113 ·
-
Support for Lifecycle rulesĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
InseeFrLab/s3-operator#112 · 1 reaction ·
Tất cả issue của InseeFrLab/s3-operator
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
openmcp-project/service-provider-crossplane#330 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openmcp-project/service-provider-kro#220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[FEATURE]: Set fieldPath and reason on the CEL validation rulesCó thể đã có người làm @bjosv đã nhận hôm nay. Đang mởenhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
valkey-io/valkey-operator#618 ·
Maintainer thường phản hồi trong vòng 3 ngày