volcano
volcano copied to clipboard
add ut and refactor for pkg/scheduler/plugins/util/k8s package
What type of PR is this?
unit test
What this PR does / why we need it:
- refactor nodelock
- add some unit test for pkg/scheduler/plugins/util/k8s/snapshot.go
- fix IsPVCUsedByPods method
Which issue(s) this PR fixes:
See more detail https://github.com/volcano-sh/volcano/issues/3053#issuecomment-2042837878
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.:
None
@lowang-bh /PTAL thank a lot!
@lowang-bh Additionally, I noticed some code duplication in this section. I intend to submit a refactoring pull request to improve it here. like those two https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/plugins/util/nodelock/nodelock.go#L79 https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/plugins/util/nodelock/nodelock.go#L112
WDYT
Additionally, I noticed some code duplication in this section. I intend to submit a refactoring pull request to improve it here. like those two https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/plugins/util/nodelock/nodelock.go#L79 https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/plugins/util/nodelock/nodelock.go#L112
WDYT
Welcom!
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign lowang-bh
You can assign the PR to them by writing /assign @lowang-bh
in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
In addition to adding unit tests, I also tried to refactor nodelock. Because it involves changes to the original logic, please reviewers to help me check it carefully. /PTAL @lowang-bh @william-wang @shinytang6
/assign @william-wang @shinytang6 Thanks for the review
done
/PTAL @william-wang @shinytang6 thanks a lot
New changes are detected. LGTM label has been removed.