-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lvol): add lvol detach parent API #186
Conversation
Longhorn 9922 Signed-off-by: Damiano Cipriani <[email protected]> Signed-off-by: Shuo Wu <[email protected]>
WalkthroughThis pull request introduces functionality to detach a logical volume (lvol) from its parent without modifying the volume's data. The changes span multiple files, including Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/cmd/basic/bdev_lvol.go (1)
30-30
: Enhance subcommand grouping for maintainability.
Adding new subcommands continuously could make this list overwhelming. Consider grouping related subcommands or using a subcommand-based CLI design pattern to improve maintainability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Dockerfile.dapper
(1 hunks)app/cmd/basic/bdev_lvol.go
(2 hunks)pkg/spdk/client/basic.go
(1 hunks)pkg/spdk/types/lvol.go
(1 hunks)
🔇 Additional comments (5)
pkg/spdk/types/lvol.go (1)
127-130
: Consider unit tests for new request struct.
The added request struct looks straightforward, but ensuring comprehensive test coverage for the new BdevLvolDetachParentRequest
will help maintain reliability and prevent regressions.
app/cmd/basic/bdev_lvol.go (2)
351-371
: Command naming is consistent.
The choice of detach
subcommand is descriptive and consistent with other commands in the file.
373-390
: Validate input preconditions.
Ensuring the parent is a “standard snapshot” is critical. Consider adding a quick pre-check or a user-friendly warning if the target lvol does not meet the standard snapshot requirement.
pkg/spdk/client/basic.go (1)
397-413
: Great addition of the detach function.
This new method is a logical counterpart to BdevLvolDecoupleParent
. Good job clarifying that no clusters are copied and that the parent must be a standard snapshot.
Dockerfile.dapper (1)
20-20
: Check stability of the new SPDK commit.
Updating SPDK_COMMIT_ID
is acceptable, but confirm that this newer commit remains stable for operations related to detaching parents, and that no breaking changes arise from dependencies in other modules.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
==========================================
- Coverage 22.61% 22.57% -0.04%
==========================================
Files 34 34
Lines 4949 4992 +43
==========================================
+ Hits 1119 1127 +8
- Misses 3652 3690 +38
+ Partials 178 175 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Which issue(s) this PR fixes:
Issue longhorn/longhorn#9922
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context