Bug 1779519

Summary: `oc --v 7` shows User-Agent as "v0.0.0...$Format"
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.3.0CC: aos-bugs, jokerman, maszulik, mfojtik, rbost
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1790954 (view as bug list) Environment:
Last Closed: 2020-05-04 11:18:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1790954    

Description Xingxing Xia 2019-12-04 06:30:50 UTC
Description of problem:
4.x `oc --v 7` shows User-Agent as "v0.0.0...$Format", while upstream-downloaded kubectl and 3.11 oc show concrete version and commit:
oc get po --v 7
I1204 14:08:48.610751   26500 loader.go:375] Config loaded from file:  /home/xxia/my/env/xxia-1204-1.cfg
I1204 14:08:48.633673   26500 round_trippers.go:420] GET https://...:6443/api/v1/namespaces/default/pods?limit=500
I1204 14:08:48.633941   26500 round_trippers.go:427] Request Headers:
I1204 14:08:48.634130   26500 round_trippers.go:431]     Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json
I1204 14:08:48.634332   26500 round_trippers.go:431]     User-Agent: oc/v0.0.0 (linux/amd64) kubernetes/$Format

kubernetes/client/bin/kubectl get po --v 7
I1204 14:08:24.252447   26493 loader.go:375] Config loaded from file:  /home/xxia/my/env/xxia-1204-1.cfg
I1204 14:08:24.292663   26493 round_trippers.go:420] GET https://...:6443/api?timeout=32s
I1204 14:08:24.292944   26493 round_trippers.go:427] Request Headers:
I1204 14:08:24.293196   26493 round_trippers.go:431]     Accept: application/json, */*
I1204 14:08:24.293433   26493 round_trippers.go:431]     User-Agent: kubectl/v1.17.0 (linux/amd64) kubernetes/97c7ccc

3.11/oc whoami --loglevel 7
I1204 14:07:32.972676   26468 loader.go:359] Config loaded from file /home/xxia/my/env/xxia-1204-1.cfg
I1204 14:07:32.973985   26468 loader.go:359] Config loaded from file /home/xxia/my/env/xxia-1204-1.cfg
I1204 14:07:32.974893   26468 round_trippers.go:383] GET https://...:6443/apis/user.openshift.io/v1/users/~
I1204 14:07:32.975082   26468 round_trippers.go:390] Request Headers:
I1204 14:07:32.975329   26468 round_trippers.go:393]     Accept: application/json, */*
I1204 14:07:32.975518   26468 round_trippers.go:393]     User-Agent: oc/v1.11.0+d4cacc0 (linux/amd64) kubernetes/d4cacc0

Version-Release number of selected component (if applicable):
rpm -qa | grep openshift-clients
openshift-clients-4.3.0-201912030917.git.1.c68c4bf.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
See above Desc

Actual results:
See above Desc

Expected results:
Should show concrete version and commit

Comment 1 Maciej Szulik 2019-12-04 20:19:17 UTC
It looks like it broke when we switched to separate repository, but it's not a critical issue that would block 4.3, although it should be backported all the way back to 4.2, since that's when it is broken too.

Comment 3 zhou ying 2020-01-15 06:20:55 UTC
Confirmed with latest oc client, the issue has fixed:

[root@dhcp-140-138 ~]# rpm -q openshift-clients
openshift-clients-4.4.0-202001141623.git.1.02696c0.el7.x86_64

[root@dhcp-140-138 ~]# oc get po --v 7
I0115 14:18:38.034722   17209 loader.go:375] Config loaded from file:  /root/kubeconfig
I0115 14:18:38.036659   17209 round_trippers.go:420] GET https://xxxxx:6443/api/v1?timeout=32s
I0115 14:18:38.036684   17209 round_trippers.go:427] Request Headers:
I0115 14:18:38.036696   17209 round_trippers.go:431]     Accept: application/json, */*
I0115 14:18:38.036707   17209 round_trippers.go:431]     User-Agent: oc/v4.4.0 (linux/amd64) kubernetes/c4243f9

Comment 5 errata-xmlrpc 2020-05-04 11:18:30 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, 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:0581