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

dra: refactoring overall flow of prepare/unprepare resources #120099

Merged
merged 1 commit into from Oct 23, 2023

Conversation

TommyStarK
Copy link
Contributor

@TommyStarK TommyStarK commented Aug 22, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

If applied this commit aims to refactor the overall flow of the node client when it has to prepare/unprepare resources.

Which issue(s) this PR fixes:

part of #119469

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 22, 2023
@TommyStarK
Copy link
Contributor Author

/area kubelet
/sig node

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Aug 22, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Aug 22, 2023
@bart0sh bart0sh added this to WIP in SIG Node PR Triage Aug 22, 2023
@TommyStarK
Copy link
Contributor Author

/retest

@TommyStarK TommyStarK changed the title WIP: dra: refactoring overall flow of prepare/unprepare resources dra: refactoring overall flow of prepare/unprepare resources Aug 22, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 22, 2023
@TommyStarK
Copy link
Contributor Author

/cc @bart0sh @klueska

First draft of refactoring the overall code of the dra plugin client. Implemented detecting version in lazy way (on first call). I also removed having two types Plugin and DraPluginClient, merged them. I changed the plugin and plugin store to not being public anymore. Finally I tried to make the functions / types defined in each file more coherent with what's contained in each file.

While waiting for your feedback guys, I'm willing to look at e2e node tests and e2e tests with kind and to potentially add new tests and try to cover as many cases as possible. I wonder if you prefer separate PRs or updating this one tho .

@bart0sh bart0sh moved this from WIP to Needs Reviewer in SIG Node PR Triage Aug 22, 2023
@bart0sh
Copy link
Contributor

bart0sh commented Aug 22, 2023

/assign @bart0sh @klueska

@bart0sh
Copy link
Contributor

bart0sh commented Aug 22, 2023

@TommyStarK if new e2e tests depend on these changes, it's better to add them to this PR. If not - a separate PR would be better.

@bart0sh
Copy link
Contributor

bart0sh commented Aug 23, 2023

/triage accepted
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Aug 23, 2023
Copy link
Contributor

@klueska klueska left a comment

Choose a reason for hiding this comment

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

First pass. Didn't thoroughly review the tests yet.

pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugin.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 18, 2023
@TommyStarK
Copy link
Contributor Author

@bart0sh @klueska PTAL

@TommyStarK
Copy link
Contributor Author

/retest-required

@bart0sh
Copy link
Contributor

bart0sh commented Sep 19, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9404dcb012cf034d6df77abe4dd25c346bc4c898

@TommyStarK
Copy link
Contributor Author

@klueska friendly ping

pkg/kubelet/cm/dra/plugin/client.go Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugins_store.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugin.go Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugins_store.go Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/plugin.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 19, 2023
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
pkg/kubelet/cm/dra/plugin/client.go Outdated Show resolved Hide resolved
Comment on lines 106 to 108
p.Lock()
p.version = v1alpha2Version
p.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add SetVersion() and GetVersion() calls to avoid needing to make the lock calls here (and in similar places) directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing, done in 55e3662. I made setVersion to accept a parameter just in case of supporting future api versions.

Signed-off-by: TommyStarK <thomasmilox@gmail.com>
Copy link
Contributor

@klueska klueska left a comment

Choose a reason for hiding this comment

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

Thanks for your patience and your quick turnaround after the reviews.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 23, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6d91a41b055d201791370176bc46626690c1262c

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klueska, TommyStarK

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit 76fc18c into kubernetes:master Oct 23, 2023
17 checks passed
SIG Node PR Triage automation moved this from Needs Approver to Done Oct 23, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 23, 2023
@TommyStarK TommyStarK deleted the gh_119469 branch October 23, 2023 17:57
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants