Skip to content

Honor stderrthreshold when logtostderr is enabled#317

Open
pierluigilenoci wants to merge 1 commit intoopenebs:developfrom
pierluigilenoci:fix/honor-stderrthreshold
Open

Honor stderrthreshold when logtostderr is enabled#317
pierluigilenoci wants to merge 1 commit intoopenebs:developfrom
pierluigilenoci:fix/honor-stderrthreshold

Conversation

@pierluigilenoci
Copy link
Copy Markdown

Summary

  • After klog.InitFlags, opt into the fixed stderrthreshold behavior introduced in klog v2.140.0
  • Bump k8s.io/klog/v2 from v2.130.1 to v2.140.0
  • Applied to cmd/provisioner-localpv/main.go

Motivation

When logtostderr is enabled (the default), klog historically suppressed the stderrthreshold flag, meaning that WARNING and ERROR messages could not be selectively filtered. klog v2.140.0 introduced new flags (legacy_stderr_threshold_behavior) to opt into the corrected behavior where stderrthreshold is properly honored.

Reference: kubernetes/klog#212

Test plan

  • Verify the application still logs to stderr as expected
  • Confirm stderrthreshold flag can be used to control which severity levels appear on stderr

After calling klog.InitFlags, opt into the fixed stderrthreshold
behavior added in klog v2.140.0 so that severe-enough messages are
still mirrored to stderr when logtostderr is set.

Reference: kubernetes/klog#212
Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
@pierluigilenoci pierluigilenoci requested a review from a team as a code owner March 26, 2026 23:16
@pierluigilenoci
Copy link
Copy Markdown
Author

cc @niladrih @Abhinandan-Purkait for review

Copy link
Copy Markdown
Member

@Abhinandan-Purkait Abhinandan-Purkait left a comment

Choose a reason for hiding this comment

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

LGTM

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