-
Notifications
You must be signed in to change notification settings - Fork 430
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
fix ever-growing log messages with overlapping fields #4302
Conversation
@@ -116,7 +116,7 @@ func (asos *ASOSecretReconciler) Reconcile(ctx context.Context, req ctrl.Request | |||
) | |||
defer done() | |||
|
|||
log = log.WithValues("namespace", req.Namespace, "AzureCluster", req.Name) |
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.
AzureCluster
is already set below if necessary.
@@ -151,8 +151,6 @@ func (r *AzureIdentityReconciler) Reconcile(ctx context.Context, req ctrl.Reques | |||
|
|||
var bindingsToDelete []aadpodv1.AzureIdentityBinding | |||
for _, b := range bindings.Items { | |||
log = log.WithValues("azureidentitybinding", b.Name) |
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 log was never getting used but the side effects from this WithValues
would have persisted after this loop which doesn't seem right.
8cd0171
to
e2fc46b
Compare
/retest |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4302 +/- ##
=======================================
Coverage 59.74% 59.75%
=======================================
Files 192 192
Lines 19299 19297 -2
=======================================
Hits 11531 11531
+ Misses 7137 7135 -2
Partials 631 631 ☔ View full report in Codecov by Sentry. |
/retest |
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
LGTM label has been added. Git tree hash: ec11983ef26596c42b679d270798bbc426eaf46c
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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 |
@nojnhuh: 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. |
/retest |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The primary change here is to create new loggers (
:=
vs=
) when adding key-value pairs to prevent those pairs from persisting longer than they should, leading to messages with an ever-growing set of redundant and mismatched values. A couple of other related minor changes also snuck into this PR.Prevents log messages like:
I1121 02:04:56.879702 1 helpers.go:116] "unable to get the owner cluster" logger="controllers.AzureMachineReconciler.SetupWithManager" controller="AzureMachine" x-ms-correlation-request-id="53f02e71-85d8-45cc-9220-d6fa3c85d019" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-ode3dx-cc-vwfnf" Namespace="capz-e2e-ode3dx" AzureCluster="capz-e2e-ode3dx-cc-vwfnf" Namespace="capz-e2e-ode3dx" AzureCluster="capz-e2e-ode3dx-cc-vwfnf" Namespace="capz-e2e-ode3dx" AzureCluster="capz-e2e-ode3dx-cc-vwfnf" Namespace="capz-e2e-ode3dx" AzureCluster="capz-e2e-ode3dx-cc-vwfnf" Namespace="capz-e2e-ode3dx" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-tc4fvl-edgezone" Namespace="capz-e2e-tc4fvl" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-20z64k-dual-stack" Namespace="capz-e2e-20z64k" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-lmw5qj-intree" Namespace="capz-e2e-lmw5qj" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-gqwffh-azwi" Namespace="capz-e2e-gqwffh" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-jl3vsc-flatcar" Namespace="capz-e2e-jl3vsc" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-gl561r-flex" Namespace="capz-e2e-gl561r" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-m20fqa-gpu" Namespace="capz-e2e-m20fqa" AzureCluster="capz-e2e-a314xj-public-custom-vnet" Namespace="capz-e2e-a314xj" AzureCluster="capz-e2e-a314xj-public-custom-vnet" Namespace="capz-e2e-a314xj"
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 #
Special notes for your reviewer:
TODOs:
Release note: