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-1168: change DevicePath field to its own type #690

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

qJkee
Copy link
Contributor

@qJkee qJkee commented Aug 9, 2024

Introduce a new type called DevicePath to contain user provided device path. This is done in order to create a standard way of working with resolved if symlink or raw(unresolved) device path and avoid errors when it's not resolved while it's expected to be.

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

openshift-ci-robot commented Aug 9, 2024

@qJkee: This pull request references OCPEDGE-1168 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 story to target the "4.18.0" version, but no target version was set.

In response to this:

Introduce a new type called DevicePath to contain user provided device path. This is done in order to create a standard way of working with resolved if symlink or raw(unresolved) device path and avoid errors when it's not resolved while it's expected to be.

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.

@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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2024
@openshift-ci openshift-ci bot requested review from eggfoobar and jerpeter1 August 9, 2024 08:25
Copy link
Contributor

openshift-ci bot commented Aug 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qJkee

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 Aug 9, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 87.01299% with 10 lines in your changes missing coverage. Please review.

Project coverage is 70.53%. Comparing base (1357036) to head (b436027).
Report is 2 commits behind head on main.

Files Patch % Lines
internal/controllers/vgmanager/wipe_devices.go 44.44% 2 Missing and 3 partials ⚠️
api/v1alpha1/lvmcluster_webhook.go 90.00% 2 Missing and 1 partial ⚠️
internal/controllers/symlink-resolver/resolver.go 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #690      +/-   ##
==========================================
- Coverage   70.66%   70.53%   -0.13%     
==========================================
  Files          47       48       +1     
  Lines        3245     3262      +17     
==========================================
+ Hits         2293     2301       +8     
- Misses        785      791       +6     
- Partials      167      170       +3     
Files Coverage Δ
api/v1alpha1/lvmcluster_types.go 100.00% <100.00%> (ø)
internal/controllers/vgmanager/controller.go 71.60% <100.00%> (+0.06%) ⬆️
internal/controllers/vgmanager/devices.go 79.34% <100.00%> (ø)
internal/controllers/vgmanager/filter/filter.go 82.35% <100.00%> (ø)
internal/controllers/symlink-resolver/resolver.go 88.23% <88.23%> (ø)
api/v1alpha1/lvmcluster_webhook.go 84.81% <90.00%> (+0.44%) ⬆️
internal/controllers/vgmanager/wipe_devices.go 74.68% <44.44%> (-1.64%) ⬇️

... and 3 files with indirect coverage changes

@qJkee
Copy link
Contributor Author

qJkee commented Aug 9, 2024

/сс @suleymanakbas91 @jakobmoellerdev

@qJkee qJkee changed the title [WIP] OCPEDGE-1168: change DevicePath field to its own type OCPEDGE-1168: change DevicePath field to its own type Aug 9, 2024
@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 Aug 9, 2024
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tad confused on the actual impact on the change, as I think we said that we want to make sure that resolution happens on a At Most Once basis. Other than that LGTM

api/v1alpha1/lvmcluster_types.go Show resolved Hide resolved
@@ -31,7 +31,7 @@ func parseMetrics(metricsResult string) ([]RawMetric, error) {
return nil, fmt.Errorf("failed to unmarshal metrics: %w", err)
}

metrics := []RawMetric{}
metrics := make([]RawMetric, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
metrics := make([]RawMetric, 0)
var metrics []RawMetric

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the last nit pending

docs/design/lvm-operator-manager.md Outdated Show resolved Hide resolved
internal/controllers/vgmanager/devices.go Outdated Show resolved Hide resolved
internal/controllers/vgmanager/kname_test.go Outdated Show resolved Hide resolved
qJkee added 2 commits August 20, 2024 18:27
match golang version in debug dockerfile
with main dockerfile
@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 20, 2024
@qJkee
Copy link
Contributor Author

qJkee commented Aug 20, 2024

/hold for review

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2024
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits, approach is LGTM for me.

Looking at the code for the resolver, it feels a little like we do not need the concurrent sync.Map access since we run in the reconcile and the reconcile doesnt have a concurrent call for device resolution AFAIK. (please correct me if im wrong)

Im also not sure if we should keep the DevicePath type because now its literally a string wrapper, although I must admit that the Unresolved() method makes it clear what is to be expected from that value. maybe a godoc would resolve that?

cmd/vgmanager/vgmanager.go Outdated Show resolved Hide resolved
internal/controllers/symlink-resolver/resolver.go Outdated Show resolved Hide resolved
internal/controllers/vgmanager/controller.go Outdated Show resolved Hide resolved
api/v1alpha1/lvmcluster_types.go Show resolved Hide resolved
@jakobmoellerdev
Copy link
Contributor

/test e2e-aws

@qJkee qJkee force-pushed the OCPEDGE-1168 branch 2 times, most recently from 438dc28 to 8ef7937 Compare August 21, 2024 13:07
Add new object for symlink resolution with caching
to reduce symlink resolution amount within reconcile loop

Also, introduce a new type called DevicePath to contain user
provided device path. This is done in order to create
a standard way of working with raw(unresolved) device
path and avoid errors when it's not resolved while
it's expected to be.
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2024
@suleymanakbas91
Copy link
Contributor

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2024
Copy link
Contributor

openshift-ci bot commented Aug 21, 2024

@qJkee: 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 cbd7567 into openshift:main Aug 21, 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.

5 participants