Skip to content

test(cli): reject object paths for ilm rules#136

Draft
overtrue wants to merge 1 commit intomainfrom
codex/test-gap-detection-202604171630
Draft

test(cli): reject object paths for ilm rules#136
overtrue wants to merge 1 commit intomainfrom
codex/test-gap-detection-202604171630

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This PR closes a small lifecycle command test gap in the ILM rule bucket path parser.

The ilm rule commands document bucket paths as alias/bucket, but the parser previously split at the first slash and accepted paths such as local/my-bucket/key.txt. That treated my-bucket/key.txt as the bucket name, so an object-style path could get past local validation and fail later as a confusing bucket lookup or backend request.

The fix keeps trailing slashes valid for bucket paths while rejecting any non-empty path segments after the bucket. The added regression assertions cover both one-segment and nested object keys.

Validation

  • cargo test -p rustfs-cli commands::ilm::rule::tests::test_parse_bucket_path_error
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

make pre-commit was requested, but this repository checkout has no Makefile and no pre-commit target, so it could not be run.

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.

1 participant