-
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
🌱 Improve logging for VSphereMachine #2395
🌱 Improve logging for VSphereMachine #2395
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2395 +/- ##
==========================================
+ Coverage 60.79% 60.86% +0.07%
==========================================
Files 164 164
Lines 9473 9435 -38
==========================================
- Hits 5759 5743 -16
+ Misses 3298 3274 -24
- Partials 416 418 +2
☔ View full report in Codecov by Sentry. |
8eca562
to
80ab893
Compare
80ab893
to
ce205df
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.
What a great refactoring PR.
Some smaller nits/questions :-)
ce205df
to
3de0f9c
Compare
3de0f9c
to
38a7116
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.
I think last round then it should be in great shape!
38a7116
to
b87781d
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 very last nit
With that lgtm/approve from my side 👍
Great job 🎉
b87781d
to
32c4b37
Compare
/lgtm /assign @killianmuldoon |
LGTM label has been added. Git tree hash: b3dc1a9e4fb06a2ca8216b2f5f6afcfacf79226e
|
32c4b37
to
83a94e2
Compare
83a94e2
to
a3f651f
Compare
@Ankitasw: 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. |
if supervisorMachineCtx.Logger.V(5).Enabled() { | ||
vms, err := getVirtualMachinesInCluster(supervisorMachineCtx) | ||
supervisorMachineCtx.Logger.Info("Trace Destroy PRE: VirtualMachines", "vmcount", len(vms), "error", err) | ||
if log.V(5).Enabled() { |
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.
I'm fine with keeping this as-is for now - but let's add a TODO to change the way this logging works - we shouldn't be using if log.V(5).Enabled()
IMO, and we should avoid deferred logging if possible
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.
Great work - I have a couple of comments, but let's just add some items to #2076
Thanks!
/lgtm
/approve
providerID := fmt.Sprintf("vsphere://%s", vm.Status.BiosUUID) | ||
|
||
if supervisorMachineCtx.VSphereMachine.Spec.ProviderID == nil || *supervisorMachineCtx.VSphereMachine.Spec.ProviderID != providerID { | ||
supervisorMachineCtx.VSphereMachine.Spec.ProviderID = &providerID | ||
supervisorMachineCtx.Logger.Info("Updated provider ID for machine", "machine", supervisorMachineCtx.VSphereMachine.Name, "provider-id", providerID) | ||
log.Info("Updated provider ID", "providerID", providerID) |
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.
Fine with this for now - keeping parity with the current state - but we should re-evaluate what we use in K/V pairs. This isn't put into the context so it's only going to appear in one log line.
LGTM label has been added. Git tree hash: 3ff45bd14dffed89ea395d9fb7573cdff34a5254
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: killianmuldoon 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 |
Also - let's focus on context refactoring instead of logging for now - that will make these PRs easier to review going forward. |
@killianmuldoon actually the context refactoring for vspheremachine controller is already done, that's why picked up this logging improvement. |
What this PR does / why we need it:
Improve logging for VSphereMachine controller and underlying packages.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #2076