Skip to content
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

OCPEDGE-1169: fix: device selection only by filter #679

Merged

Conversation

jakobmoellerdev
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev commented Jul 29, 2024

This changes our device selection methodology to try to unify all selection criteria into the filters.

Previously, we had a complex flow with getNewDevicesToBeAdded and filters together.
This now changes this so that all filter criteria are purely handled through filterDevices.

It achieves this by:

  1. Creating a new filter function to verify that a block device must be part of the deviceSelector if the deviceSelector is present, otherwise this is a no-op filter
  2. Introducing VerifyMandatoryDevicePaths(devs FilteredBlockDevices, paths[]string) error as a shortcut to determine if a given path is already setup. This can be used together with .Spec.storage.deviceClasses[].deviceSelector.Paths to ensure presence of mandatory paths. For optional paths this check is simply skipped

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 29, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 29, 2024

@jakobmoellerdev: This pull request references OCPEDGE-1169 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the spike to target the "4.17.0" version, but no target version was set.

In response to this:

This changes our device selection methodology to try to unify all selection criteria into the filters.

Previously, we had a complex flow with getNewDevicesToBeAdded and filters together.
This now changes this so that all filter criteria are purely handled through filterDevices.

It achieves this by:

  1. Creating a new filter function to verify that a block device must be part of the deviceSelector if the deviceSelector is present, otherwise this is a no-op filter
  2. Introducing CheckAvailableOrAlreadySetupPaths(devs []string) error on FilteredBlockDevices as a shortcut to determine if a given path is already setup

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.

Copy link
Contributor

openshift-ci bot commented Jul 29, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 29, 2024
Copy link
Contributor

openshift-ci bot commented Jul 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jakobmoellerdev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2024
@jakobmoellerdev
Copy link
Contributor Author

/test all

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 82.72727% with 19 lines in your changes missing coverage. Please review.

Project coverage is 58.52%. Comparing base (b71b1c6) to head (4354446).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #679      +/-   ##
==========================================
+ Coverage   57.78%   58.52%   +0.74%     
==========================================
  Files          55       55              
  Lines        4285     4282       -3     
==========================================
+ Hits         2476     2506      +30     
+ Misses       1559     1533      -26     
+ Partials      250      243       -7     
Files Coverage Δ
internal/controllers/vgmanager/lvm/lvm.go 99.08% <100.00%> (ø)
internal/controllers/vgmanager/wipe_devices.go 72.88% <66.66%> (ø)
internal/controllers/vgmanager/filter/filter.go 82.35% <88.46%> (-0.41%) ⬇️
internal/controllers/vgmanager/controller.go 72.22% <83.33%> (+0.93%) ⬆️
internal/controllers/vgmanager/lsblk/lsblk.go 0.00% <0.00%> (ø)
internal/controllers/vgmanager/devices.go 79.00% <85.41%> (-1.00%) ⬇️

... and 5 files with indirect coverage changes

@jakobmoellerdev jakobmoellerdev force-pushed the device-name-consistency branch from d86eaa5 to 4354446 Compare July 30, 2024 08:14
@jakobmoellerdev
Copy link
Contributor Author

/test all

@jakobmoellerdev
Copy link
Contributor Author

/test unit-test

@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review July 30, 2024 09:27
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 30, 2024
@openshift-ci openshift-ci bot requested review from eggfoobar and jerpeter1 July 30, 2024 09:27
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 30, 2024

@jakobmoellerdev: This pull request references OCPEDGE-1169 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the spike to target the "4.17.0" version, but no target version was set.

In response to this:

This changes our device selection methodology to try to unify all selection criteria into the filters.

Previously, we had a complex flow with getNewDevicesToBeAdded and filters together.
This now changes this so that all filter criteria are purely handled through filterDevices.

It achieves this by:

  1. Creating a new filter function to verify that a block device must be part of the deviceSelector if the deviceSelector is present, otherwise this is a no-op filter
  2. Introducing VerifyMandatoryDevicePaths(devs FilteredBlockDevices, paths[]string) error as a shortcut to determine if a given path is already setup. This can be used together with .Spec.storage.deviceClasses[].deviceSelector.Paths to ensure presence of mandatory paths. For optional paths this check is simply skipped

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.

@suleymanakbas91
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2024
@jakobmoellerdev
Copy link
Contributor Author

/test e2e-aws
/test e2e-aws-single-node

Copy link
Contributor

openshift-ci bot commented Jul 30, 2024

@jakobmoellerdev: all tests passed!

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 1e7e301 into openshift:main Jul 30, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants