fix: honor klog -stderrthreshold even when -logtostderr is true#168
Open
pierluigilenoci wants to merge 1 commit intooam-dev:masterfrom
Open
fix: honor klog -stderrthreshold even when -logtostderr is true#168pierluigilenoci wants to merge 1 commit intooam-dev:masterfrom
pierluigilenoci wants to merge 1 commit intooam-dev:masterfrom
Conversation
klog v2 defaults -logtostderr to true, which silently ignores -stderrthreshold — all log levels go to stderr unconditionally. This has been an open issue since 2020 (kubernetes/klog#212). klog v2.140.0 introduced a fix behind an opt-in flag (legacy_stderr_threshold_behavior). This commit bumps klog to v2.140.0 and enables the fix in both entry points so that -stderrthreshold is honored, while preserving the current default behavior (stderrthreshold=INFO means all logs still go to stderr unless the user overrides it on the command line). Ref: kubernetes/klog#212 Ref: kubernetes/klog#432 Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #168 +/- ##
==========================================
- Coverage 10.51% 10.50% -0.01%
==========================================
Files 49 49
Lines 7029 7034 +5
==========================================
Hits 739 739
- Misses 6238 6243 +5
Partials 52 52
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
klog v2 defaults
-logtostderrtotrue, which silently ignores-stderrthreshold— all log levels go to stderr unconditionally. This has been an open issue since 2020.klog v2.140.0 introduced a fix behind an opt-in flag (
legacy_stderr_threshold_behavior). This PR bumps klog to v2.140.0 and enables the fix in both entry points (cmd/addon-manager/main.goandpkg/config/args_log.go) so that-stderrthresholdis honored, while preserving the current default behavior.References
Summary by cubic
Honor
-stderrthresholdeven when-logtostderris true by enablingklog’s new behavior. Default stderr logging stays at INFO unless the user changes it.Bug Fixes
legacy_stderr_threshold_behavior=falseand defaultstderrthreshold=INFOincmd/addon-manager/main.goandpkg/config/args_log.go.Dependencies
k8s.io/klog/v2tov2.140.0.Written for commit 4b6d706. Summary will update on new commits.