-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 log k/v pairs and a improve/drop a few log lines #9813
🐛 Improve log k/v pairs and a improve/drop a few log lines #9813
Conversation
/test pull-cluster-api-e2e-full-main |
/cherry-pick release-1.6 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.6 in a new PR and assign it to you. In response to this:
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. |
/cherry-pick release-1.5 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
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. |
0e329f6
to
fa4d1fe
Compare
if configOwner.GetKind() == "Machine" { | ||
// AddOwners adds the owners of Machine as k/v pairs to the logger. | ||
// Specifically, it will add KubeadmControlPlane, MachineSet and MachineDeployment. | ||
ctx, log, err = clog.AddOwners(ctx, r.Client, configOwner) |
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.
We have to call clog.AddOwner with the Machine and not with the KubeadmConfig. Only the Machine has the KCP, MS, MD owner hierarchy
bootstrap/kubeadm/main.go
Outdated
@@ -294,7 +294,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) { | |||
|
|||
// Set up a ClusterCacheTracker and ClusterCacheReconciler to provide to controllers | |||
// requiring a connection to a remote cluster | |||
log := ctrl.Log.WithName("remote").WithName("ClusterCacheTracker") | |||
log := ctrl.Log.WithValues("component", "remote/clustercachetracker") |
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.
WithName just adds a prefix to all messages. We stopped using that in all other places.
This adds something similar to the controller or webhook k/v pair. I called it component because the CCT is not a controller
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 about adding this k/v pair to log inside NewClusterCacheTracker vs doing this before every call to this method?
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.
Good idea. Done
@@ -890,7 +890,7 @@ func (r *Reconciler) updateStatus(ctx context.Context, cluster *clusterv1.Cluste | |||
availableReplicasCount++ | |||
} | |||
} else if machine.GetDeletionTimestamp().IsZero() { | |||
log.Info("Waiting for the Kubernetes node on the machine to report ready state") | |||
log.V(4).Info("Waiting for the Kubernetes node on the machine to report ready state") |
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.
This is way to verbose on log level 0 and seems totally out-of-place (it's confusing if the MS controller is logging on log level 0 that it's waiting for a node to become ready. It is only doing that for status calculation but otherwise doesn't influence MS reconciliation). Similar logs around here use log level 4
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.
Ever so slight nit to break this out into its own PR.
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 moved the event recorder stuff to a separate PR and changed the scope of this PR to "fix k/v paris and improve/drop a few log lines". I think that should be okay
/cherry-pick release-1.6 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.6 in a new PR and assign it to you. In response to this:
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. |
/cherry-pick release-1.5 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
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. |
/test pull-cluster-api-e2e-full-main |
/assign @fabriziopandini @chrischdi |
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 question, as of that
/lgtm
fa4d1fe
to
9751194
Compare
9751194
to
525add5
Compare
/hold cancel Moved the event recorder change in its own PR and changed the scope of this PR /assign @fabriziopandini @chrischdi |
/lgtm |
LGTM label has been added. Git tree hash: 14394659cbe9fad6e34e3f8734c240121b4756d6
|
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 nit, otherwise lgtm
bootstrap/kubeadm/main.go
Outdated
@@ -294,7 +294,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) { | |||
|
|||
// Set up a ClusterCacheTracker and ClusterCacheReconciler to provide to controllers | |||
// requiring a connection to a remote cluster | |||
log := ctrl.Log.WithName("remote").WithName("ClusterCacheTracker") | |||
log := ctrl.Log.WithValues("component", "remote/clustercachetracker") |
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 about adding this k/v pair to log inside NewClusterCacheTracker vs doing this before every call to this method?
525add5
to
87e940d
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.
/lgtm
/approve
LGTM label has been added. Git tree hash: a142ee1bb2bafca69175b5f0e29519aa3afcf520
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
@sbueringer: new pull request created: #9880 In response to this:
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. |
@sbueringer: #9813 failed to apply on top of branch "release-1.5":
In response to this:
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. |
What this PR does / why we need it:
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 #