Bug 1715001 - oc and openshift-intall version show "dirty" no matter the rc.x clients or extracted from payload
Summary: oc and openshift-intall version show "dirty" no matter the rc.x clients or ex...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.3.0
Assignee: Sally
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks: 1728714 1773257 1790537
TreeView+ depends on / blocked
 
Reported: 2019-05-29 11:04 UTC by Xingxing Xia
Modified: 2020-02-24 07:28 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: ld flags were incorrectly set Consequence: oc and openshift-install version reported GitTreeState and GitVersion "dirty" Fix: properly set GO_LD_EXTRAFLAGS Result: oc and openshift-install version no longer report GitTreeState and GitVersion "dirty"
Clone Of:
: 1773257 (view as bug list)
Environment:
Last Closed: 2020-01-23 11:04:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 1829 0 'None' closed Bug 1715001: hack/build: Use BUILD_VERSION if non-empty 2020-09-22 20:37:09 UTC
Github openshift oc pull 88 0 'None' closed Bug 1715001: If extracted from payload, 'oc version' reports payload version 2020-09-22 20:37:09 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-01-23 11:04:41 UTC

Internal Links: 1728714

Description Xingxing Xia 2019-05-29 11:04:34 UTC
Description of problem:
oc and openshift-intall version show dirty no matter the RC.x clients or extracted from payload

Version-Release number of selected component (if applicable):
rc.7
4.1.0-0.nightly-2019-05-24-040103

How reproducible:
Always

Steps to Reproduce:
1. Download oc and openshift-intall from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.1.0-rc.7/, run `./oc version` and `./openshift-intall version`
2. Extract them from payload by oc adm release extract --command=oc/openshift-install ...payload..., run `./oc version` and `./openshift-intall version`

Actual results:
Show "dirty":
./oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0-201905191700+7bd2e5b-dirty", GitCommit:"7bd2e5b", GitTreeState:"dirty", BuildDate:"2019-05-19T23:52:43Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

$ ./openshift-install version
./openshift-install v4.1.0-201905212232-dirty
built from commit 71d8978039726046929729ad15302973e3da18ce
release image registry.svc.ci.openshift.org/ocp/release@sha256:28217ed180a85572ddeb8a6ea0dba18d25432e1a566960314380daa225e1519b

Expected results:
As clients to customer, should not show "dirty"

Additional info:

Comment 1 Xingxing Xia 2019-05-29 13:11:06 UTC
oc from repo http://download-node-02.eng.bos.redhat.com/rcm-guest/puddles/RHAOS/AtomicOpenShift/4.1/latest/x86_64/os/Packages/openshift-clients-4.1.0-201905191700.git.0.cb455d6.el7.x86_64.rpm doesn't have dirty
oc version --client
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0", GitCommit:"cb455d664", GitTreeState:"clean", BuildDate:"2019-05-19T21:13:58Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 5 W. Trevor King 2019-08-29 04:26:18 UTC
Installer PR landed, which means future 4.2 installer builds will no longer contain "dirty".  I'm moving this over to 'oc' so they can address their side of this (likely through version injection when extracting tools from the release image).  Then we'll hop on and use the same code to get extraction-time version injection in the installer.

Comment 6 Eric Rich 2019-09-05 20:21:16 UTC
(In reply to W. Trevor King from comment #5)
> Installer PR landed, which means future 4.2 installer builds will no longer
> contain "dirty".  I'm moving this over to 'oc' so they can address their
> side of this (likely through version injection when extracting tools from
> the release image).  Then we'll hop on and use the same code to get
> extraction-time version injection in the installer.

If half of this is fixed we should someone denote this! 

We either need to mark this for 4.2 (what I am doing) and fix both parts (preferred) 
or isolate this bug to the 'openshift-installer' parts and create an 'oc' bug to track when 'oc' will fix this.

Comment 7 W. Trevor King 2019-09-05 21:54:50 UTC
I am agnostic on "fix both" vs. "split bugs"; the oc folks can take whichever path they like.

Comment 8 Xingxing Xia 2019-09-06 02:26:53 UTC
The issue for oc is also fixed in 4.2.0-0.nightly-2019-09-05-234433. Could move to VERIFIED once ON_QA
oc adm release extract --command=oc registry.svc.ci.openshift.org/ocp/release:4.2.0-0.nightly-2019-09-05-234433
./oc version --client
Client Version: version.Info{Major:"", Minor:"", GitVersion:"openshift-clients-4.2.0-201909020729", GitCommit:"9ff96feb1aea1217938e2f1aeaf0be091cc59728", GitTreeState:"clean", BuildDate:"2019-09-02T15:22:22Z", GoVersion:"go1.12.8", Compiler:"gc", Platform:"linux/amd64"}

Comment 9 W. Trevor King 2019-09-06 03:53:57 UTC
> Could move to VERIFIED once ON_QA

Do we need to track down the oc commit that fixed this?  If not, we could just move this back to MODIFIED and the ART sweeper will pull it into ON_QA the next time it runs.

Comment 10 Xingxing Xia 2019-09-06 04:57:38 UTC
Not sure which oc or ART release repo commit does it

Comment 11 Maciej Szulik 2019-09-06 08:24:39 UTC
The oc version just go an upgrade to how it prints version, current output is:

$ oc version
Client Version: v4.2.0-alpha.0-58-g71775b7
Server Version: 4.2.0-0.ci-2019-09-05-164031
Kubernetes Version: v1.14.0+56982c1

which is oc from latest payload. It's clean and simple, dirty I'm assuming is coming from ART and we should not quite worry
about it. We will work with art to figure this out in the next release, for now I'm lowering the priority and pushing this 
to 4.3.

Comment 12 Sally 2019-09-10 14:03:24 UTC
wrt reporting payload version rather than built version when extracting tools with 'oc adm release extract --tools', this PR is open: https://github.com/openshift/oc/pull/88

Comment 14 zhou ying 2019-10-24 07:11:07 UTC
Confirmed with latest version, the issue has fixed:
oc from yum repo:

[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: "2019-10-24T01:16:52Z"
  compiler: gc
  gitCommit: 8bf0a6cf35883df6e739e4b5e36c2d185e88d46e
  gitTreeState: clean
  gitVersion: v4.3.0
  goVersion: go1.12.8
  major: ""
  minor: ""
  platform: linux/amd64
openshiftVersion: 4.3.0-0.nightly-2019-10-23-150053

oc extracted from payload:
[root@dhcp-140-138 ~]# ./oc version  -o yaml 
clientVersion:
  buildDate: "2019-10-18T17:47:34Z"
  compiler: gc
  gitCommit: 3780d2dee116713bde709485b22ec6eed2c242ce
  gitTreeState: clean
  gitVersion: openshift-clients-4.3.0-201910181317
  goVersion: go1.12.8
  major: ""
  minor: ""
  platform: linux/amd64
openshiftVersion: 4.3.0-0.nightly-2019-10-23-150053
releaseClientVersion: 4.3.0-0.nightly-2019-10-23-150053

Comment 16 errata-xmlrpc 2020-01-23 11:04:11 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:0062


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