Migrate from klog v1 to klog/v2 and honor stderrthreshold#7363
Migrate from klog v1 to klog/v2 and honor stderrthreshold#7363pierluigilenoci wants to merge 1 commit intoredhat-developer:mainfrom
Conversation
- Replace all `k8s.io/klog` (v1) imports with `k8s.io/klog/v2` across 91 non-vendor Go source files - Fix klog v1→v2 API change: `klog.V(level)` now returns `Verbose` instead of `bool`, update to use `.Enabled()` in podman.go - Upgrade `k8s.io/klog/v2` from v2.100.1 to v2.140.0 - Configure `legacy_stderr_threshold_behavior=false` and `stderrthreshold=INFO` flags after `klog.InitFlags()` so that klog properly honors the stderr threshold setting - Regenerate vendor/ directory Ref: kubernetes/klog#212, kubernetes/klog#432 Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
|
Hi @pierluigilenoci. Thanks for your PR. I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|



Summary
k8s.io/klog(v1) import withk8s.io/klog/v2across all 91 non-vendor Go source filesklog.V(level)returnsklog.Verboseinstead ofboolin v2, updated to use.Enabled()inpkg/podman/podman.gok8s.io/klog/v2from v2.100.1 to v2.140.0legacy_stderr_threshold_behavior=falseandstderrthreshold=INFOflags afterklog.InitFlags()incmd/odo/odo.goso that klog properly honors the stderr threshold settingvendor/directoryMotivation
k8s.io/klogv1 is deprecated and unmaintained. The v2 module is the actively maintained replacement.Additionally, klog v2 introduced a behavioral change where
stderrthresholddefaults toERRORbut the legacy behavior silently overrides it. Settinglegacy_stderr_threshold_behavior=falseensures thestderrthresholdflag is actually respected.Ref: kubernetes/klog#212, kubernetes/klog#432
Test plan
go build ./...passes (all packages)go mod tidyproduces clean dependency graphgo mod vendorregenerated successfully/cc @feloy @rm3l @kadel