Skip to content

feat: reconcile bucket versioning and object lock - #260

Merged
GatewayJ merged 2 commits into
rustfs:mainfrom
GatewayJ:feat/issue-255-bucket-configuration
Sep 18, 2026
Merged

GatewayJ merged 2 commits into
rustfs:mainfrom
GatewayJ:feat/issue-255-bucket-configuration

Conversation

@GatewayJ

Copy link
Copy Markdown
Member

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Closes #255

Summary of Changes

  • Add declarative bucket versioning and objectLockConfiguration fields, including Governance and Compliance retention in days and an ownership-aware Absent state.
  • Add bounded, strict S3 versioning and Object Lock configuration GET/PUT support in rustfs-admin, with type-safe versioning write commands.
  • Send and sign the S3-required Content-MD5 header for versioning and Object Lock configuration writes.
  • Reconcile versioning before Object Lock, verify every mutation with a fresh read, and preserve ownership hashes so externally managed retention is not overwritten.
  • Expose the new spec and status fields through the CRD, OpenAPI, Console types, status details, examples, user guides, and changelog.

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (if user-visible change)
  • CI/CD passed (pending GitHub Actions)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: changes S3-visible bucket versioning and Object Lock behavior when the new fields are explicitly configured.

The new CRD fields and status fields are optional, so existing Tenant manifests remain compatible. Installations must apply the updated Tenant CRD before using the new fields.

Verification

cargo test -p rustfs-admin
cargo test -p operator existing_bucket_enables_versioning_before_object_lock -- --nocapture
make pre-commit
git diff --check origin/main...HEAD

Additional Notes

Live-cluster e2e tests were not run. The non-live e2e harness is covered by make pre-commit.

Rollback can remove the new fields to stop active management, but S3 Object Lock itself cannot be disabled after activation. Compliance retention already applied to object versions remains subject to the server's retention rules.

High-risk validation

  • Correctness: verified versioning-before-Object-Lock ordering, exact Governance/Compliance wire values, required Content-MD5 values, boundary validation, post-write reads, and refusal to suspend versioning on an Object Lock bucket.
  • Security: bounded configuration responses and strict XML parsing reject unknown, duplicate, ambiguous, malformed, and non-positive retention data without logging credentials or configuration payloads. S3 checksums are included in SigV4 signed headers.
  • Compatibility: existing manifests remain valid; omitted fields stay unmanaged; live S3 Years retention is readable; the issue's concise YAML shape is preserved.
  • Concurrency and durability: mutations are idempotent, status ownership hashes guard read-modify-write behavior, post-write reads detect ineffective writes, and matching live state is safely adopted after interrupted reconciliation.
  • Simplicity: S3 wire semantics remain in rustfs-admin, while the operator reconcile layer owns ordering, conflict policy, and status persistence.
  • Test coverage: focused protocol and reconcile tests distinguish both retention modes, ownership drift, explicit removal, write verification, request order, signed request checksums, and versioning transitions; the complete repository pre-commit gate passed.

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.

@GatewayJ
GatewayJ added this pull request to the merge queue Sep 18, 2026
Merged via the queue into rustfs:main with commit d947750 Sep 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add objectLockConfiguration (mode/days) and versioning parameters to Tenant bucket spec

1 participant