Bug 1883489 - openshift-apiserver: Logging is broken due to mix of k8s.io/klog v1 and v2
Summary: openshift-apiserver: Logging is broken due to mix of k8s.io/klog v1 and v2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-apiserver
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.0
Assignee: Stefan Schimanski
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-29 11:22 UTC by Stefan Schimanski
Modified: 2020-10-27 16:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1883461
Environment:
Last Closed: 2020-10-27 16:46:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-apiserver pull 142 0 None closed Bug 1883489: Upgrade to klog v2 and eliminate unnecessary s2i dependency 2021-01-11 03:07:16 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:46:52 UTC

Description Stefan Schimanski 2020-09-29 11:22:20 UTC
+++ This bug was initially created as a clone of Bug #1883461 +++

k8s.io/klog moved to v2 in client-go and frieds. The operator does not use v2 yet and hence, we lose one half of the logging output (v2).

--- Additional comment from Stefan Schimanski on 2020-09-29 13:09:06 CEST ---

I did some tests using openshift-apiserver that uses kube component-base to add klog command line flags:

$ ./openshift-apiserver start --config asfd --v=4
I0929 13:04:18.354425   53628 cmd.go:57] v1 klog
I0929 13:04:18.354506   53628 cmd.go:58] v2 klog
I0929 13:04:18.354512   53628 cmd.go:61] v2 V(2) klog
I0929 13:04:18.354515   53628 cmd.go:64] v2 V(4) klog

So this means that we DO NOT set verbosity for v1 klog, and hence lose all the klogv1.V(2).Infof output.

Comment 3 Ke Wang 2020-10-15 05:07:13 UTC
$ oc get clusterversion
NAME      VERSION      AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-rc.4   True        False         159m    Cluster version is 4.6.0-rc.4

$ oc rsh -n openshift-apiserver apiserver-7778f8746b-pwzj4
Defaulting container name to openshift-apiserver.
Use 'oc describe pod/apiserver-7778f8746b-pwzj4 -n openshift-apiserver' to see all of the containers in this pod.

sh-4.4# openshift-apiserver start --config asfd --v=4
F1015 03:43:51.700701      23 cmd.go:72] open asfd: no such file or directory
goroutine 1 [running]:
k8s.io/klog/v2.stacks(0xc000132001, 0xc0002ec160, 0x4e, 0xa4)
	k8s.io/klog/v2.0/klog.go:996 +0xb9
k8s.io/klog/v2.(*loggingT).output(0x47c4f20, 0xc000000003, 0x0, 0x0, 0xc000c05f10, 0x46b012f, 0x6, 0x48, 0x1957c00)
	k8s.io/klog/v2.0/klog.go:945 +0x191
k8s.io/klog/v2.(*loggingT).printDepth(0x47c4f20, 0xc000000003, 0x0, 0x0, 0x1, 0xc000f9fb90, 0x1, 0x1)
	k8s.io/klog/v2.0/klog.go:718 +0x165
k8s.io/klog/v2.(*loggingT).print(...)
	k8s.io/klog/v2.0/klog.go:703
k8s.io/klog/v2.Fatal(...)
	k8s.io/klog/v2.0/klog.go:1443
...

klog/v2 is in used in the log,moving bug VERIFIED.

Comment 5 errata-xmlrpc 2020-10-27 16:46:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.