fix(admin): align heal commands with RustFS API#142
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f5a3a3e2c
ℹ️ 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".
| impl From<&HealStartRequest> for RustfsHealOptions { | ||
| fn from(request: &HealStartRequest) -> Self { | ||
| Self { | ||
| recursive: false, |
There was a problem hiding this comment.
Enable recursive mode for root heal starts
When rc admin heal start <alias> is invoked without --bucket/--prefix, rustfs_heal_path() targets /heal/, but this conversion always sends recursive: false. On RustFS/MinIO-style heal APIs, non-recursive root heal requests are treated as status/no-op flows rather than a full namespace heal, so the command can report success without actually starting a heal run. Set recursive based on request scope (at least for the root /heal/ case) to preserve the documented “all buckets” behavior.
Useful? React with 👍 / 👎.
Related Issue
Resolves rustfs/rustfs#2538
Background
rc admin heal startwas calling/rustfs/admin/v3/heal/startwith the CLI request shape. RustFS expects the admin heal route to be/rustfs/admin/v3/heal/or/rustfs/admin/v3/heal/{bucket}with the serverHealOptsJSON body. The mismatch caused RustFS to return an XMLInvalidRequestresponse, which rc surfaced asInvalid path.Solution
HealOptsJSON shape.forceStop=trueand a valid body.400 Bad Requestresponses as bad requests instead of path parsing failures.Tests
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspacerc admin heal start local,rc admin heal start local --json, andrc admin heal status local --json