Repository navigation
fix(cmd): add stop subcommand to check preflight, trim volume, and get replica - #583
kiusys-mstreitenberger wants to merge 2 commits into
Conversation
…t replica Mirrors the existing install preflight stop / export replica stop pattern. If one of these commands is interrupted before its PostRun cleanup runs, the DaemonSet (and RBAC, for check preflight) it created is left behind in the cluster. stop lets the user clean those up manually. checksum is intentionally left out: its Cleanup() is a no-op since it only patches the Volume CR directly and creates no cluster resources that could be orphaned. Issue longhorn/longhorn#9311 Signed-off-by: Nicolás Streitenberger <mnstreitenberger@gmail.com>
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
🟡 Changes recommended
The hidden --enable-spdk flag is incorrectly registered as a string rather than a boolean, causing cleanup via appended stop to fail when the flag is supplied without a value.
1 open issue
What changed in this PR
Adds explicit cleanup commands for interrupted remote operations, allowing users to remove orphaned cluster resources without rerunning the parent operation.
Changes:
- Adds
stopsubcommands tocheck preflight,trim volume, andget replica. - Initializes each operation and calls its existing cleanup method.
- Registers hidden parent options to support reusing command invocations with
stopappended.
| File | Description |
|---|---|
cmd/remote/subcmd/trim.go |
Adds volume-trimmer stop and cleanup handling. |
cmd/remote/subcmd/get.go |
Adds replica-getter stop and cleanup handling. |
cmd/remote/subcmd/check.go |
Adds preflight-checker stop and cleanup handling. |
Review effort: Balanced
| utils.SetGlobalOptionsRemote(cmd, globalOpts) | ||
|
|
||
| // Hidden, not removed, so `stop` can be appended to the parent command as-is. | ||
| utils.SetFlagHidden(cmd, consts.CmdOptEnableSpdk) |
There was a problem hiding this comment.
@kiusys-mstreitenberger Could you address the comment? Thanks.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #583 +/- ##
=========================================
+ Coverage 3.15% 6.80% +3.65%
=========================================
Files 53 57 +4
Lines 4597 4510 -87
=========================================
+ Hits 145 307 +162
+ Misses 4449 4203 -246
+ Partials 3 0 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Which issue(s) this PR fixes:
Issue longhorn/longhorn#9311
What this PR does / why we need it:
A
stopcommand has been added tocheck preflight,trim volume, andget replica.checksumwas deliberately excluded: itsCleanup()is a no-op, as it merelyupdates the Volume CR directly and does not create any cluster resources that
could become orphaned.
Special notes for your reviewer:
stopcommand follows the exact pattern ofexport replica stop.stopstopcommand removes them.Additional documentation or context