FFFF
Skip to content

fix: use kube logger with status waiter#31717

Merged
scottrigby merged 2 commits intohelm:mainfrom
AustinAbro321:use-logger-with-waiter
Jan 23, 2026
Merged

fix: use kube logger with status waiter#31717
scottrigby merged 2 commits intohelm:mainfrom
AustinAbro321:use-logger-with-waiter

Conversation

@AustinAbro321
Copy link
Copy Markdown
Contributor
@AustinAbro321 AustinAbro321 commented Jan 12, 2026

What this PR does / why we need it:

Currently unless the global slogger is set, SDK users will not receive any logs at all from the waiter. This is critical as several minutes can go by without any feedback to users. Relates to #31585

If applicable:

  • this PR contains user facing changes (the docs needed label should be applied if so)
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 12, 2026
@AustinAbro321 AustinAbro321 marked this pull request as ready for review January 12, 2026 15:30
@AustinAbro321 AustinAbro321 changed the title feat: use logger with waiter feat: use kube logger with status waiter Jan 12, 2026
@benoittgt
Copy link
Copy Markdown
Contributor
benoittgt commented Jan 12, 2026

Hello @AustinAbro321

Inspired by my snipet. I tested your code, and it is working as expected:

cd /Users/benoit.tigeot/projects/helm-sdk-repro && go run main.go
time=2026-01-12T22:16:08.029+01:00 level=INFO msg="Starting Helm upgrade test with new slog integration" deployment-id=12345
time=2026-01-12T22:16:08.031+01:00 level=INFO msg="Upgrading release" deployment-id=12345 release=simple-test chart=../simple-test
time=2026-01-12T22:16:08.055+01:00 level=DEBUG msg="preparing upgrade" deployment-id=12345 name=simple-test
time=2026-01-12T22:16:08.098+01:00 level=DEBUG msg="determined release apply method" deployment-id=12345 server_side_apply=true previous_release_apply_method=ssa
time=2026-01-12T22:16:08.171+01:00 level=DEBUG msg="performing update" deployment-id=12345 name=simple-test
time=2026-01-12T22:16:08.236+01:00 level=DEBUG msg="creating upgraded release" deployment-id=12345 name=simple-test
time=2026-01-12T22:16:08.247+01:00 level=DEBUG msg="using server-side apply for resource creation" deployment-id=12345 forceConflicts=true dryRun=false fieldValidationDirective=Strict
time=2026-01-12T22:16:08.247+01:00 level=DEBUG msg="using server-side apply for resource update" deployment-id=12345 forceConflicts=true dryRun=false fieldValidationDirective=Strict upgradeClientSideFieldManager=false
time=2026-01-12T22:16:08.247+01:00 level=DEBUG msg="checking resources for changes" deployment-id=12345 resources=3
time=2026-01-12T22:16:08.258+01:00 level=DEBUG msg="Patched resource" deployment-id=12345 namespace=default name=simple-test gvk="/v1, Kind=ServiceAccount"
time=2026-01-12T22:16:08.266+01:00 level=DEBUG msg="Patched resource" deployment-id=12345 namespace=default name=simple-test gvk="/v1, Kind=Service"
time=2026-01-12T22:16:08.274+01:00 level=DEBUG msg="Patched resource" deployment-id=12345 namespace=default name=simple-test gvk="apps/v1, Kind=Deployment"
time=2026-01-12T22:16:08.275+01:00 level=DEBUG msg="waiting for resources" deployment-id=12345 count=3 timeout=5m0s
time=2026-01-12T22:16:08.291+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=Unknown
time=2026-01-12T22:16:08.291+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=Unknown
time=2026-01-12T22:16:08.325+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:08.380+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:08.409+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:08.424+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:11.931+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:11.952+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:11.974+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:15.023+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:15.043+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:15.068+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:18.134+01:00 level=DEBUG msg="waiting for resource" deployment-id=12345 namespace=default name=simple-test kind=Deployment expectedStatus=Current actualStatus=InProgress
time=2026-01-12T22:16:18.153+01:00 level=DEBUG msg="all resources achieved desired status" deployment-id=12345 desiredStatus=Current resourceCount=3
time=2026-01-12T22:16:18.157+01:00 level=DEBUG msg="updating status for upgraded release" deployment-id=12345 name=simple-test
time=2026-01-12T22:16:18.159+01:00 level=INFO msg="Upgrade successful" deployment-id=12345 release=simple-test version=8 status=deployed

Edit: I am wondering about the duplication in logs of deployment object. Here is during a RollingUpdate. Maybe it could be improved?

@AustinAbro321
Copy link
Copy Markdown
Contributor Author

@benoittgt Yeah the logging strategy can be improved, though I believe it's a different scope than this PR. Right now it's firing a log every time the statusobserver is called. The benefit of this is that a user will always know at least one resource that they're waiting on. The downside is that it fires a ton of logs and the more resources in the chart the more logs it writes.

What do you think of a separate goroutine that will log a not ready resource every X seconds and removing the log from the status observer? This would mirror the behavior of the old Helm status logger. I could spin up a separate PR for this

@benoittgt
Copy link
Copy Markdown
Contributor

Yeah the logging strategy can be improved, though I believe it's a different scope than this PR.

Completely agree.

What do you think of a separate goroutine that will log a not ready resource every X seconds and removing the log from the status observer?

I think it's a good idea. But maybe we should get other points of view first, to avoid unnecessary work for you.

TerryHowe
TerryHowe previously approved these changes Jan 18, 2026
Copy link
Copy Markdown
Contributor
@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

gjenkins8
gjenkins8 previously approved these changes Jan 21, 2026
@gjenkins8
Copy link
Copy Markdown
Member

@AustinAbro321 -- changes look good, can you please rebase / fix conflicts

Signed-off-by: Austin Abro <austinabro321@gmail.com>
@AustinAbro321 AustinAbro321 force-pushed the use-logger-with-waiter branch from 5b7efdf to 63b40a7 Compare January 22, 2026 14:12
@AustinAbro321
Copy link
Copy Markdown
Contributor Author

@gjenkins8 @TerryHowe Changes are rebased, codeql seems to be failing for unrelated reasons

Signed-off-by: Austin Abro <austinabro321@gmail.com>
Copy link
Copy Markdown
Member
@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, lgtm. though is this a feature or a bug that we didn't catch in the earlier fix: #31411?

@matheuscscp
Copy link
Copy Markdown
Contributor

nice work, lgtm. though is this a feature or a bug that we didn't catch in the earlier fix: #31411?

@scottrigby Well observed, I think the bug was introduced here: #13604

And yes, could have been fixed in #31411

@scottrigby scottrigby changed the title feat: use kube logger with status waiter fix: use kube logger with status waiter Jan 23, 2026
@scottrigby scottrigby added the bug Categorizes issue or PR as related to a bug. label Jan 23, 2026
@scottrigby scottrigby added this to the 4.1.1 milestone Jan 23, 2026
@scottrigby scottrigby merged commit f928025 into helm:main Jan 23, 2026
5 checks passed
@gjenkins8 gjenkins8 added the picked Indicates that a PR has been cherry-picked into the next release candidate. label Jan 29, 2026
@gjenkins8 gjenkins8 removed the picked Indicates that a PR has been cherry-picked into the next release candidate. label Feb 9, 2026
@scottrigby scottrigby removed this from the 4.1.1 milestone Feb 9, 2026
@scottrigby scottrigby added this to the 4.1.2 milestone Feb 9, 2026
@scottrigby scottrigby added the needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. label Feb 9, 2026
@scottrigby scottrigby modified the milestones: 4.1.2, 4.1.3 Mar 11, 2026
@scottrigby scottrigby added picked Indicates that a PR has been cherry-picked into the next release candidate. and removed needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Categorizes issue or PR as related to a bug. picked Indicates that a PR has been cherry-picked into the next release candidate. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

0