Bug 1793267 - [RPM-packed oc ] `oc version -o yaml` does not show the oc detailed version information, blocking QE 4.4 auto test
Summary: [RPM-packed oc ] `oc version -o yaml` does not show the oc detailed version i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.4
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On: 1788357
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-21 03:19 UTC by zhou ying
Modified: 2020-03-16 13:38 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Internal build components has moved places. Consequence: oc version wasn't outputting proper version information. Fix: Update internal build components with the new paths. Result: oc version is providing correct information about its version.
Clone Of: 1788357
Environment:
Last Closed: 2020-02-12 06:45:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift library-go pull 697 None closed Bug 1793267: Add -mod=vendor fallback for `go list` 2020-05-15 02:48:09 UTC
Github openshift oc pull 279 None closed Bug 1793267: Add verify-deps target 2020-05-15 02:48:09 UTC
Github openshift oc pull 284 None closed Bug 1793267: Add -mod=vendor fallback for `go list` 2020-05-15 02:48:11 UTC

Comment 1 zhou ying 2020-01-21 03:20:51 UTC
oc installed by RPM-packed still has this issue:

[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: ""
  compiler: gc
  gitCommit: ""
  gitTreeState: ""
  gitVersion: unknown
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64
....

[root@dhcp-140-138 ~]# rpm -q openshift-clients
openshift-clients-4.4.0-202001170700.git.1.35f9dad.el7.x86_64

Comment 2 Xingxing Xia 2020-01-22 03:33:52 UTC
Shiyang, Yuxiang, Luke and Vikas,
  Since QE's auto test slaves extract latest oc automatically from latest above RPM, retrieve client version from that oc to run tests for the versioned cases, now QE's 4.4 auto test failed and is blocked due to this bug.
  So adding this needinfo request to you, please help address it by making the oc in above RPM include the fix of bug 1788357 ASAP.
  Thank you in advance.

Comment 3 Yuxiang Zhu 2020-01-22 08:35:47 UTC
@lmeyer has created tag https://github.com/openshift/oc/tree/openshift-clients-4.4. Succeeding builds should have correct version.

Comment 6 Maciej Szulik 2020-01-28 12:20:39 UTC
In https://github.com/openshift/oc/pull/250 we fixed the ld flags injected into the command, I have a PR also for 4.3 fixing the same issue. 
All the data are read from current git, this includes the gitVersion, gitCommit and gitTreeState. If those cannot be read properly from 
repository then can be injected into build system through these 3 variables: SOURCE_GIT_TAG, SOURCE_GIT_COMMIT, SOURCE_GIT_TREE_STATE.

I hope the above will help unstick ART.

Comment 9 Maciej Szulik 2020-02-05 08:34:46 UTC
Not there yet, still missing one final PR.

Comment 11 zhou ying 2020-02-06 01:28:23 UTC
Confirmed with latest oc clients, the issue still can reproduce:
[root@dhcp-140-138 ~]# rpm -q openshift-clients
openshift-clients-4.4.0-202002052231.git.1.3433f68.el7.x86_64

[root@dhcp-140-138 ~]# oc version -o yaml
clientVersion:
  buildDate: ""
  compiler: gc
  gitCommit: ""
  gitTreeState: ""
  gitVersion: unknown
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

Comment 12 Maciej Szulik 2020-02-10 11:23:13 UTC
This was merged into oc on Feb 6th, so the build with a fix must be older than Feb 7th, at least. Moving back to modified.

Comment 14 zhou ying 2020-02-11 01:39:48 UTC
The issue has fixed:
[root@localhost ~]# oc version -o yaml 
clientVersion:
  buildDate: "2020-02-10T17:21:47Z"
  compiler: gc
  gitCommit: ee05f83cb8f0bee84c0a1516591437cd71befdc8
  gitTreeState: clean
  gitVersion: v4.4.0
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

Comment 15 Yuxiang Zhu 2020-02-18 02:33:24 UTC
Fixed in latest releases.


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