Skip to content

chore(deps): bump k8s.io/klog/v2 from v2.130.1 to v2.140.0#3221

Open
pierluigilenoci wants to merge 1 commit into
devspace-sh:mainfrom
pierluigilenoci:fix/honor-stderrthreshold
Open

chore(deps): bump k8s.io/klog/v2 from v2.130.1 to v2.140.0#3221
pierluigilenoci wants to merge 1 commit into
devspace-sh:mainfrom
pierluigilenoci:fix/honor-stderrthreshold

Conversation

@pierluigilenoci

@pierluigilenoci pierluigilenoci commented Apr 22, 2026

Copy link
Copy Markdown

Summary

Routine vendored dependency update: bumps k8s.io/klog/v2 from v2.130.1 to v2.140.0.

Note on original PR description: The original description claimed this would improve severity-based log filtering. @zerbitx correctly pointed out that devspace already routes all klog output to io.Discard via SetOutput, so the application-level change was a no-op. This updated PR is honest about that — it is a pure routine version bump.

Changes

  • go.mod: bump k8s.io/klog/v2 v2.130.1 → v2.140.0
  • vendor/: update vendored klog/v2 to v2.140.0

@netlify

netlify Bot commented Apr 22, 2026

Copy link
Copy Markdown

Deploy Preview for devspace-docs canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 02b65d3
🔍 Latest deploy log https://app.netlify.com/projects/devspace-docs/deploys/6a33875a74a1af0008ea4c7c

@pierluigilenoci

Copy link
Copy Markdown
Author

Hi — friendly follow-up. CI is green and all checks pass. Would you be able to review when you get a chance? Thank you!

@zerbitx

zerbitx commented May 28, 2026

Copy link
Copy Markdown
Collaborator

The state after the function runs looks like:

  • logtostderr=false (set last, as before)
  • stderrthreshold=INFO (new — added by this PR)
  • legacy_stderr_threshold_behavior=false (new — added by this PR)

With logtostderr false, we skip this and make it into the also to stderr bit so we'll have both err and info. I haven't run it, but I think this will make the logs noiser.

@pierluigilenoci

Copy link
Copy Markdown
Author

Thank you for the review and the detailed walkthrough!

You're right. I traced the execution path more carefully:

Since logtostderr=false is set, the output() function enters the else branch (not the else if l.toStderr branch). In that branch, the "also to stderr" condition is:

(!l.alsoToStderr && s >= l.stderrThreshold.get())

With stderrthreshold=INFO and alsoToStderr=false (default), this evaluates to true for every log message — so all klog output would be written to stderr, making things noisier rather than quieter.

The legacy_stderr_threshold_behavior flag only applies inside the else if l.toStderr branch, which is never reached here because logtostderr=false. So it has no effect on this code path.

The fix is to remove the stderrthreshold=INFO line. I'll push an updated version — would you prefer I also drop the legacy_stderr_threshold_behavior=false line (making it a minimal diff: just the klog version bump), or keep it as a no-op signal of awareness of the new flag?

@pierluigilenoci pierluigilenoci changed the title fix: honor -stderrthreshold when -logtostderr=true fix: bump klog/v2 to v2.140.0 and silence verbose stderr logging Jun 4, 2026
@pierluigilenoci

Copy link
Copy Markdown
Author

Thanks @zerbitx for the detailed walkthrough — you were right.

I traced through the code again: with logtostderr=false, output() enters the else branch (not else if l.toStderr). In that branch the condition to also write to stderr is !l.alsoToStderr && s >= l.stderrThreshold.get(). With stderrthreshold=INFO that evaluates to true for every log level, so everything was being routed to stderr — the opposite of the intended suppression. The legacy_stderr_threshold_behavior flag has no effect because the else if l.toStderr branch is never reached when logtostderr=false.

I've pushed an updated version that drops both flag registrations. The change is now just the klog/v2 bump to v2.140.0 plus logtostderr=false + SetOutput(io.Discard) — consistent with how klogv1 is already initialized in the same function.

Routine vendored dependency update. No behavioral changes to devspace —
klog output is already fully silenced via SetOutput(io.Discard).

Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
@pierluigilenoci pierluigilenoci force-pushed the fix/honor-stderrthreshold branch from bd5a694 to 02b65d3 Compare June 18, 2026 05:51
@pierluigilenoci pierluigilenoci changed the title fix: bump klog/v2 to v2.140.0 and silence verbose stderr logging chore(deps): bump k8s.io/klog/v2 from v2.130.1 to v2.140.0 Jun 18, 2026
@pierluigilenoci

Copy link
Copy Markdown
Author

Hi @zerbitx — thanks for the review that caught the no-op issue. I've simplified the PR to an honest routine dep bump (k8s.io/klog/v2 v2.130.1 → v2.140.0) with no behavioral changes, and updated the description accordingly. Would a pure version bump like this be welcome, or would you prefer I close this? Happy either way — just want to avoid leaving a zombie PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants