Feature/extend lvset matcher - add filtering by serial to deviceInclusionSpec in LocalVolumeSet#638
Feature/extend lvset matcher - add filtering by serial to deviceInclusionSpec in LocalVolumeSet#638ssato wants to merge 2 commits into
Conversation
Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughAdds a ChangesSerial filter support
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ssato The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ssato. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/diskmaker/controllers/lvset/matcher.go`:
- Around line 204-219: Update inSerialList in matcher.go to use exact serial
matching instead of substring matching: trim whitespace and compare
case-insensitively with equality against dev.Serial, and keep the existing
nil/empty spec behavior unchanged. Make sure matchesDeviceSpec only accepts true
serial matches, and add a TestInSerialList case that proves a prefix/suffix
collision like "1234" no longer matches a longer serial.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 22e81c32-01f8-4357-8474-0f4ef80f2ea0
📒 Files selected for processing (4)
api/v1alpha1/localvolumeset_types.gopkg/diskmaker/controllers/lvset/matcher.gopkg/diskmaker/controllers/lvset/matcher_test.gopkg/internal/diskutil_test.go
ded1f52 to
e574b46
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/diskmaker/controllers/lvset/matcher.go`:
- Around line 204-222: The serial matcher in `inSerialList` no longer matches
the documented contract for `DeviceInclusionSpec.Serials`, since it now uses
exact case-insensitive equality instead of substring containment. Update the
controller logic in `matcher.go` to follow the intended “contains” behavior, or
adjust the `DeviceInclusionSpec.Serials` documentation and CRD description in
`localvolumeset_types.go` so both the API contract and `inSerialList` behavior
are consistent.
- Around line 204-221: In the inSerialList matcher, blank-only serial filters
should be treated the same as an empty filter. Update the logic in matcher.go so
that after trimming spec.Serials entries, if no non-blank serials remain the
function returns true, nil instead of falling through to false. Keep the
existing pass-through behavior for nil spec and an explicitly empty Serials
list, and apply the fix within inSerialList using the existing strings.TrimSpace
and strings.EqualFold flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 47a06de9-05b2-4779-8297-c2aa3172cd97
📒 Files selected for processing (3)
api/v1alpha1/localvolumeset_types.gopkg/diskmaker/controllers/lvset/matcher.gopkg/diskmaker/controllers/lvset/matcher_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
- api/v1alpha1/localvolumeset_types.go
e574b46 to
93ab267
Compare
Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
93ab267 to
0c6697d
Compare
Hello,
I couldn't find the specific guidelines for submitting feature extensions as a PR, so I'm not entirely sure if this meets your standards. Please let me know if there's anything missing or if any changes are needed.
Currently, it seems that deviceInclusionSpec in LocalVolumeSet doesn't allow selecting a specific disk when there are multiple disks with the same vendor, model, and capacity. This PR extends its capability to allow users to do so by specifying the serial number.
Summary by CodeRabbit