fix(provisioning): protect existing RustFS users - #212
Conversation
23e50b9 to
3deb26e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c77c9a23f2
ℹ️ 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".
| matches!( | ||
| previous.state.as_str(), | ||
| state if state == ProvisioningItemState::Ready.as_str() | ||
| || state == ProvisioningItemState::Retained.as_str() | ||
| ) && previous.last_applied_access_key_hash.as_deref() == Some(current_access_key_hash.as_str()) |
There was a problem hiding this comment.
Allow proven failed legacy users to migrate
When upgrading a Tenant whose operator-managed user was previously Ready but whose latest reconciliation left it Failed—for example because a referenced policy became unavailable or set_user_policy failed—the legacy status still preserves the matching observedSecretName and lastAppliedAccessKeyHash. Restricting migration to Ready or Retained rejects that proof, so the existing user enters UserOwnershipConflict and remains blocked even after the original configuration problem is fixed; accept matching failed legacy statuses that retain complete applied-identity metadata.
Useful? React with 👍 / 👎.
Type of Change
Related Issues
Closes rustfs/backlog#1098
Summary of Changes
ReadyandRetainedcheckpoints while preserving crash recovery and credential rotation.Blockedstates.resourceVersionconflicts and CRD unknown-field pruning.Checklist
make pre-commit(fmt-check + clippy + test + console-lint + console-fmt-check)[Unreleased](if user-visible change)Impact
Verification
Additional Notes
Apply the updated Tenant CRD before rolling out the new Operator. Helm does not upgrade CRDs already installed from a chart's
crds/directory. If the old schema prunes ownership, the Operator now fails closed before any RustFS credential or policy write.RustFS currently has no conditional create-user API or external ownership metadata. The Kubernetes checkpoint and stale-snapshot guard protect the normal serialized controller path, but they cannot provide exactly-once delivery against independent RustFS actors. A fully atomic boundary requires a future RustFS create-only operation with a persistent idempotency or ownership token.
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.