Skip to content

feat: allow RustFS to validate tenant storage layouts#150

Merged
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:feat/snsd-tenant-layout
Jun 25, 2026
Merged

feat: allow RustFS to validate tenant storage layouts#150
GatewayJ merged 1 commit into
rustfs:mainfrom
GatewayJ:feat/snsd-tenant-layout

Conversation

@GatewayJ

Copy link
Copy Markdown
Member

Type of Change

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

Related Issues

Fixes #144

Summary of Changes

  • Remove operator-side RustFS storage layout validation from the Tenant CRD and Console API paths.
  • Keep only Kubernetes/operator constructability checks such as positive server and volume counts, unique pool names, peer DNS label length, and immutable existing pool shape.
  • Render RUSTFS_VOLUMES as a local path only for a single-pool single-node single-disk Tenant; multi-pool tenants use peer DNS entries so RustFS receives an accurate global topology.
  • Update Console defaults, examples, and user guides to show 1x1 development tenants and clarify that RustFS validates storage layout at startup.

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] (N/A: this repository has no CHANGELOG.md)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact: RustFS now owns storage layout, erasure set, and parity compatibility validation.

Verification

cargo test types::v1alpha1::tenant::workloads::tests::single_node_single_disk_statefulset_uses_local_rustfs_volume
cargo test types::v1alpha1::tenant::workloads::tests::mixed_pool_single_node_single_disk_uses_peer_dns_volume
make pre-commit
git diff --check

Additional Notes

This does not add a separate standalone mode. The operator only infers the local RUSTFS_VOLUMES=/data/rustfs0 form for the single-pool 1x1 case; other accepted layouts are passed through to RustFS with peer DNS topology.

@GatewayJ GatewayJ marked this pull request as ready for review June 25, 2026 11:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd48ba7c4a

ℹ️ 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".

Comment on lines +61 to +62
if self.spec.pools.len() == 1 && pool.is_single_node_single_disk() {
return format!("{base_path}/rustfs0");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid changing existing pool endpoint identity on expansion

When a Tenant starts as the new default single-pool 1x1 layout, this returns /data/rustfs0; after adding any second pool, the same existing pool no longer satisfies self.spec.pools.len() == 1, so its rendered RUSTFS_VOLUMES changes to the peer-DNS form. The reconciler treats env changes as StatefulSet updates, and pool lifecycle matching uses this same cmdline string, so expanding a 1x1 Tenant can restart the original pool with a different endpoint identity and then fail to match the pool RustFS already reports.

Useful? React with 👍 / 👎.

@GatewayJ GatewayJ added this pull request to the merge queue Jun 25, 2026
Merged via the queue into rustfs:main with commit ffd8058 Jun 25, 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.

Support standalone not distributed instances

1 participant