add tenant provisioning#131
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df178257bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const ASSUME_ROLE_PATH: &str = "/"; | ||
| const ADD_USER_PATH: &str = "/rustfs/admin/v3/add-user"; | ||
| const USER_INFO_PATH: &str = "/rustfs/admin/v3/user-info"; | ||
| const SET_POLICY_PATH: &str = "/rustfs/admin/v3/set-policy"; |
There was a problem hiding this comment.
Use the RustFS policy mapping endpoint
For tenants that declare users, set_user_policy now signs PUTs to /rustfs/admin/v3/set-policy, but the RustFS/MinIO admin API path used for this operation is /rustfs/admin/v3/set-user-or-group-policy with these query parameters. Against a live RustFS server this returns an unexpected status, so user provisioning fails after creating the user and the requested policies are never attached.
Useful? React with 👍 / 👎.
| if !exists | ||
| && let Err(error) = client | ||
| .add_user(&credentials.access_key, &credentials.secret_key) | ||
| .await |
There was a problem hiding this comment.
Rotate managed users when their Secret changes
When a provisioned user's Secret is updated after initial creation with the same access key but a new secret key, this branch skips add_user for existing users and then records the new Secret resourceVersion as Ready. RustFS still has the old secret key, so clients using the updated Kubernetes Secret fail authentication while status says the user is configured; update managed users when the observed Secret changes, or avoid marking the new Secret version as applied.
Useful? React with 👍 / 👎.
Type of Change
Related Issues
N/A
Summary of Changes
Adds Tenant-driven bucket/user/policy provisioning for RustFS Operator.
This PR extends the Tenant CRD with
spec.policies,spec.users, andspec.buckets, plus per-itemstatus.provisioningand aProvisioningReadycondition. The controller reconciles policies, users, and buckets after workloads are ready, using MinIO-aligned bucket semantics while keeping RustFS-specific policy ownership and explicit user policy mapping rules.Main changes:
rustfs.tenantlabel or Tenant ownerReference.Checklist
make pre-commit(fmt-check + clippy + test + console-lint + console-fmt-check)[Unreleased](if user-visible change)Impact
ProvisioningReady=Truebefore final Ready.Verification
Additional Notes