Bug 1779519 - `oc --v 7` shows User-Agent as "v0.0.0...$Format"
Summary: `oc --v 7` shows User-Agent as "v0.0.0...$Format"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks: 1790954
TreeView+ depends on / blocked
 
Reported: 2019-12-04 06:30 UTC by Xingxing Xia
Modified: 2020-05-04 11:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1790954 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:18:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift oc pull 250 None closed Bug 1779519: fix version ldflags 2020-04-15 06:17:03 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:18:49 UTC

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


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