feat: add ILM (lifecycle/tiering) and bucket replication commands#60
Merged
feat: add ILM (lifecycle/tiering) and bucket replication commands#60
Conversation
Add three major feature groups to the rc CLI: 1. Lifecycle rule management (rc ilm rule add/edit/list/remove/export/import) 2. Storage tier management (rc ilm tier add/edit/list/info/remove) 3. Object restore (rc ilm restore) 4. Bucket replication (rc replicate add/update/list/status/remove/export/import) Core changes: - Add LifecycleRule, LifecycleConfiguration types to rc-core - Add TierConfig, TierType, TierCreds types matching RustFS admin API format - Add ReplicationConfiguration, ReplicationRule, BucketTarget types - Extend ObjectStore trait with lifecycle/replication/restore methods - Extend AdminApi trait with tier and replication target methods - Add lifecycle and replication fields to Capabilities - Implement all ObjectStore methods in S3Client (aws-sdk-s3) - Implement all AdminApi methods in AdminClient (HTTP+SigV4) - Add help contract tests for all new commands - Update README with ILM, tier, and replication documentation
overtrue
requested changes
Mar 20, 2026
Contributor
There was a problem hiding this comment.
Thanks for putting this feature set together. I found a few correctness issues in the new lifecycle and replication flows that look blocking before merge.
ilm rule addcan overwrite an existing lifecycle configuration after any failed read.- The lifecycle and replication read/modify/write paths do not preserve tag-based filters from existing rules.
replicate exportandreplicate importdo not round-trip the admin-side remote target state.- Removing replication rules leaves the registered remote targets behind.
replicate updateaccepts target-level flags that are never applied.
I also ran cargo test --workspace; it passes, but the new coverage is mostly help and path parsing and does not exercise these stateful round-trips.
overtrue
requested changes
Mar 20, 2026
Contributor
overtrue
left a comment
There was a problem hiding this comment.
Plz check the review comments
Contributor
Author
|
Addressed the requested review changes and pushed the updates to Summary:
Validation run locally:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Summary of Changes
Add three major feature groups to the
rcCLI: lifecycle management (ILM), storage tiering, and bucket replication. These features follow the MinIOmcCLI UX conventions and communicate with the RustFS backend via standard S3 APIs and Admin APIs.1. Lifecycle Rule Management (
rc ilm rule)Supported rule properties:
--expiry-days,--expiry-date,--transition-days,--transition-date,--storage-class,--noncurrent-expiry-days,--noncurrent-transition-days,--noncurrent-transition-storage-class,--prefix,--expired-object-delete-marker,--newer-noncurrent-versions,--disable2. Storage Tier Management (
rc ilm tier)--forceoption)Tier config matches the RustFS admin API JSON format exactly (polymorphic structure with type + sub-config per tier type).
3. Object Restore (
rc ilm restore)4. Bucket Replication (
rc replicate)Architecture
The implementation follows the existing three-layer pattern:
Core Layer (
rc-core)lifecycle.rs,replication.rs,admin/tier.rsObjectStoretrait: +7 methods (get/set/delete lifecycle, restore, get/set/delete replication)AdminApitrait: +9 methods (5 tier ops + 4 replication target ops)Capabilities: addedlifecycleandreplicationfieldsS3 Layer (
rc-s3)S3Client: Implements lifecycle methods viaaws-sdk-s3(PutBucketLifecycleConfiguration, GetBucketLifecycleConfiguration, etc.), replication via standard S3 replication APIs, and RestoreObjectAdminClient: Implements tier management via HTTP+SigV4 (/rustfs/admin/v3/tier*) and remote target management (/rustfs/admin/v3/set-remote-target, etc.)CLI Layer (
rustfs-cli)ilm/mod.rs,ilm/rule.rs,ilm/tier.rs,ilm/restore.rs,replicate.rs--jsonoutput,--forcecapability bypass, and human-readable table outputFiles Changed
New Files (8)
crates/core/src/lifecycle.rscrates/core/src/replication.rscrates/core/src/admin/tier.rscrates/cli/src/commands/ilm/mod.rscrates/cli/src/commands/ilm/rule.rscrates/cli/src/commands/ilm/tier.rscrates/cli/src/commands/ilm/restore.rscrates/cli/src/commands/replicate.rsModified Files (10)
crates/core/src/lib.rscrates/core/src/admin/mod.rscrates/core/src/traits.rscrates/s3/src/client.rscrates/s3/src/admin.rscrates/s3/src/capability.rscrates/cli/src/commands/mod.rscrates/cli/tests/help_contract.rsREADME.md.gitignoreChecklist
cargo fmt --all --checkpassescargo clippy --workspace -- -D warningspasses (zero warnings)cargo test --workspacepasses (all 481+ tests)Validation
Verified against live RustFS instance (
rustfs/rustfs:latest):Impact