Bug 1806825 - oc extracted from payload version info show gitTreeState: dirty discorrectly
Summary: oc extracted from payload version info show gitTreeState: dirty discorrectly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Release
Version: 4.4
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.6.0
Assignee: Luke Meyer
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-25 05:53 UTC by zhou ying
Modified: 2020-10-27 15:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 15:55:31 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift doozer pull 234 0 None closed ART-1811, Bug 1806825: Fix gitTreeState in `oc version` 2020-10-26 12:27:45 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 15:56:10 UTC

Description zhou ying 2020-02-25 05:53:15 UTC
Description of problem:
oc extracted from payload show: gitTreeState: dirty,gitVersion: openshift-clients-4.4-57-g9353dc46

Version-Release number of selected component (if applicable):
Payload: 4.4.0-0.nightly-2020-02-25-015247
clientVersion:
  buildDate: "2020-02-21T09:20:36Z"
  compiler: gc
  gitCommit: 9353dc4631653a8de08d4b2508f1820a1fd0f15e
  gitTreeState: dirty
  gitVersion: openshift-clients-4.4-57-g9353dc46
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

How reproducible:
Always

Steps to Reproduce:
1. Extract oc from payload: 
`oc adm release extract --command='oc' registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-02-25-015247`
2. Check oc version

Actual results:
2. Show :
clientVersion:
  buildDate: "2020-02-21T09:20:36Z"
  compiler: gc
  gitCommit: 9353dc4631653a8de08d4b2508f1820a1fd0f15e
  gitTreeState: dirty
  gitVersion: openshift-clients-4.4-57-g9353dc46
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64
2. Show :
clientVersion:
  buildDate: "2020-02-21T09:20:36Z"
  compiler: gc
  gitCommit: 9353dc4631653a8de08d4b2508f1820a1fd0f15e
  gitTreeState: dirty
  gitVersion: openshift-clients-4.4-57-g9353dc46
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64


Expected results:
2. Should show : gitTreeState: clean

Additional info:
oc installed from yum works well

Comment 1 Maciej Szulik 2020-02-26 11:01:44 UTC
This is a problem coming from ART, if you check 
http://download.eng.bos.redhat.com/brewroot/packages/ose-cli-artifacts-container/v4.4.0/202002260631/data/logs/x86_64-build.log

you'll notice that only OS_GIT_TREE_STATE=clean is set at the top, but not SOURCE_GIT_TREE_STATE.
The former is used when producing rpms, the latter is being used for binaries. We should ensure
that both are set to clean, iow:

SOURCE_GIT_TREE_STATE=clean and OS_GIT_TREE_STATE=clean should be set by ART.

Having said this, I'm sending this to ART team.

Comment 6 Yuxiang Zhu 2020-06-28 06:58:39 UTC
PR https://github.com/openshift/doozer/pull/234 should be able to fix this.

Comment 9 zhou ying 2020-07-03 02:32:17 UTC
Checked with the latest oc extracted from payload: 4.6.0-0.nightly-2020-07-03-010217, the issue still could reproduce :

[root@dhcp-140-138 ~]# ./oc version --client -o yaml 
clientVersion:
  buildDate: "2020-07-02T09:44:24Z"
  compiler: gc
  gitCommit: ad8b00fb56b2e0263a08404df252ba9a87b0b872
  gitTreeState: dirty
  gitVersion: openshift-clients-4.6.0-202006250705.p0-2-gad8b00fb5
  goVersion: go1.14.4
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.6.0-0.nightly-2020-07-03-010217

Comment 10 Yuxiang Zhu 2020-07-03 12:19:46 UTC
The fix hasn't been deployed to ART's build system. We expect this will be fixed in next week's release.

Comment 12 zhou ying 2020-07-06 09:04:09 UTC
The issue has fixed:
oc extracted from payload: 
[root@dhcp-140-138 ~]# ./oc version --client -o yaml 
clientVersion:
  buildDate: "2020-07-05T15:35:18Z"
  compiler: gc
  gitCommit: fdc10d05ca16e71b8b1ae8b99fc4e257600787c5
  gitTreeState: clean
  gitVersion: openshift-clients-4.6.0-202006250705.p0-6-gfdc10d05c
  goVersion: go1.14.4
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.6.0-0.nightly-2020-07-06-033705

oc installed from yum repo
[root@dhcp-140-138 ~]# oc version --client -o yaml 
clientVersion:
  buildDate: "2020-07-05T15:05:22Z"
  compiler: gc
  gitCommit: fdc10d05ca16e71b8b1ae8b99fc4e257600787c5
  gitTreeState: clean
  gitVersion: 4.6.0-202007051425.p0-fdc10d0
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

Comment 14 errata-xmlrpc 2020-10-27 15:55:31 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.