-
Notifications
You must be signed in to change notification settings - Fork 295
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
✨ Refactor context for vspherevm controller #2398
✨ Refactor context for vspherevm controller #2398
Conversation
Hi @xiujuanx. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2398 +/- ##
==========================================
- Coverage 61.02% 60.96% -0.07%
==========================================
Files 163 163
Lines 9435 9434 -1
==========================================
- Hits 5758 5751 -7
- Misses 3263 3268 +5
- Partials 414 415 +1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!!
This is a large one :-) As vspherevm_controller.go will call lots of util functions, many of them need a refactoring. Our goal is to remove the wrapped context.Context in the customized Context here, so any function that's using customized context as a "context", we need to refactor and add a new parameter (ctx context.Context), that is the right context we need to pass down.
a56bc18
to
0a708de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small question, otherwise LGTM
Please address the comments above, then I think we are good to go :-) |
3eed7da
to
4808bcc
Compare
Hi @zhanggbj @Ankitasw , thanks for your review and valuable comments, I am very appreciate for this! Now, I have addressed all comments for this PR, so could you please help take a look again? Thank you again! |
@xiujuanx for golangci-lint: you may have to rebase (just guessing). apidiff is expected to fail because we change the signature of some functions. |
Linter findings seem to be valid though. This PR is also on my review list :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, about the golint and apidiff check errors, some of codes I don't touch any more, they are still marked to error. Do I need to fix all errors or not in this PR?
@xiujuanx I think it's better we fix those lint errors in this PR itself, otherwise we won't be able to merge this PR, as other PRs would also start breaking with same error. I see majorly lint errors related to ctx field is unused, we can just mark those fields as empty (_ context.Context
). Whenever in further PRs if it is required, we can add back that field declaration.
@xiujuanx For linter errors, please evaluate them and fix it in this PR, basically if there's logger(which will be refactored in separate PR) or we need context in the function, we should keep the For apidiff check, this is in expectation as we changed signature, and this test is optional for merging :-) |
4808bcc
to
a220b84
Compare
Thanks @chrischdi @Ankitasw @zhanggbj for your comments and suggestions! I rebased the main branch and fixed some lint errors. Now, the golint job passes. |
a220b84
to
779ca08
Compare
779ca08
to
ab095d6
Compare
Thanks for the hard word :-) |
LGTM label has been added. Git tree hash: 3e148a2653b6348ac582e58d983f0257f9dbde9c
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/test pull-cluster-api-provider-vsphere-e2e-main |
@zhanggbj looks like the E2E tests are failing due to other reasons. @chrischdi is following up on the same. |
Yeah, tests which are using the storage policy currently all fail because of an issue in VMC. |
/retest |
@xiujuanx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
/approve /hold if @killianmuldoon wants to take a look too. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi 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 |
/hold cancel |
Thanks for this huge PR 🎉 |
What this PR does / why we need it:
Refactor context for vSphereVM controller and underlying functions that vSphereVM controller are consuming, this is a part of #2295.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes part of #2295