OCPBUGS-52262: Allow filtering out devices by the device name#599
OCPBUGS-52262: Allow filtering out devices by the device name#599tsmetana wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@tsmetana: This pull request references Jira Issue OCPBUGS-52262, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (wduan@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughAdded a DeviceExclusionSpec to the LocalVolumeSet API enabling glob-pattern device exclusion by kernel name, generated deepcopy methods, updated CRD schema, implemented exclusion matcher logic and tests, and integrated exclusion checks into the device reconciliation flow. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ 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 APPROVED This pull-request has been approved by: tsmetana The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/diskmaker/controllers/lvset/reconcile.go (1)
351-351: Guardlvsetbefore dereferencing exclusion spec ingetValidDevices.Line 351 dereferences
lvset.Specunconditionally. Extracting inclusion/exclusion specs once with anlvset != nilguard would make this helper robust and remove reliance on global-map test setup.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/diskmaker/controllers/lvset/reconcile.go` at line 351, In getValidDevices, avoid unguarded dereference of lvset by first checking lvset != nil and extracting the inclusion/exclusion specs (e.g., DeviceInclusionSpec and DeviceExclusionSpec) into local variables before using them; replace direct references like lvset.Spec.DeviceExclusionSpec with the local variables and short-circuit or return an appropriate default when lvset is nil so the function no longer relies on a global-map test setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/diskmaker/controllers/lvset/reconcile.go`:
- Line 351: In getValidDevices, avoid unguarded dereference of lvset by first
checking lvset != nil and extracting the inclusion/exclusion specs (e.g.,
DeviceInclusionSpec and DeviceExclusionSpec) into local variables before using
them; replace direct references like lvset.Spec.DeviceExclusionSpec with the
local variables and short-circuit or return an appropriate default when lvset is
nil so the function no longer relies on a global-map test setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0ab34cfc-2eb6-45a5-b4fb-8667e33db345
📒 Files selected for processing (7)
api/v1alpha1/localvolumeset_types.goapi/v1alpha1/zz_generated.deepcopy.goconfig/manifests/stable/local.storage.openshift.io_localvolumesets.yamlpkg/diskmaker/controllers/lvset/device_age_test.gopkg/diskmaker/controllers/lvset/matcher.gopkg/diskmaker/controllers/lvset/matcher_test.gopkg/diskmaker/controllers/lvset/reconcile.go
| // '*' matches any sequence of non-separator characters. | ||
| // Example: ["rbd*"] excludes all rbd0, rbd1, etc. | ||
| // +optional | ||
| DeviceNameFilter []string `json:"deviceNameFilter,omitempty"` |
There was a problem hiding this comment.
OK. Hopefully this is fine.
922cf7e to
49c7283
Compare
|
@tsmetana: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
/lgtm |
This should fix the problem with LSO picking up (and corrupting) RBD devices on Virt clusters. The patch adds a new
deviceExclusionSpectype that allows for filtering out devices based on device name pattern (e.g.rbd*, which should fix the referenced bug).