Bug 1861097

Summary: Kube API reports OCP version instead of Kube version
Product: OpenShift Container Platform Reporter: Russell Teague <rteague>
Component: ReleaseAssignee: Luke Meyer <lmeyer>
Status: CLOSED ERRATA QA Contact: Gaoyun Pei <gpei>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.6CC: aos-bugs, dbosanac, gpei, jokerman, jupierce, lmeyer, mfojtik, mnewby, mrajanna, muagarwa, nberry, obabec, ocs-bugs, rcyriac, smaitra, tnielsen, vavuthu, xxia
Target Milestone: ---Keywords: TestBlocker, TestBlockerForLayeredProduct
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1875739 (view as bug list) Environment:
Last Closed: 2020-10-27 16:17:21 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: 1852357    

Description Russell Teague 2020-07-27 19:54:04 UTC
Description of problem:
When running `oc version`, the serverVersion reported is based on OCP version instead of the kube version.

Version-Release number of selected component (if applicable):
4.6.0-0.nightly-2020-07-25-091217

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
$ ./bin/oc version --output=json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "openshift-clients-4.6.0-202006250705.p0-38-gb6f8f97e7",
    "gitCommit": "b6f8f97e76dd72ee9a7189701d548f16bd38de27",
    "gitTreeState": "clean",
    "buildDate": "2020-07-24T11:31:29Z",
    "goVersion": "go1.14.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "serverVersion": {
    "major": "4",                                             <--- OCP
    "minor": "6+",                                            <--- OCP
    "gitVersion": "v4.6.0-202007250017.p0-dirty",
    "gitCommit": "00b9f189ec41c5b49c514cde9916ee031ebdaf65",
    "gitTreeState": "dirty",
    "buildDate": "2020-07-24T21:33:50Z",
    "goVersion": "go1.14.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "releaseClientVersion": "4.6.0-0.nightly-2020-07-25-091217",
  "openshiftVersion": "4.6.0-0.nightly-2020-07-25-091217"
}



Expected results:
On 4.5, this is the output:
$ ./bin/oc version --output=json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "openshift-clients-4.5.0-202006231303.p0-4-gb66f2d3a6",
    "gitCommit": "b66f2d3a6893be729f1b8660309a59c6e0b69196",
    "gitTreeState": "clean",
    "buildDate": "2020-07-24T07:19:24Z",
    "goVersion": "go1.13.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "serverVersion": {
    "major": "1",                                              <--- Kube
    "minor": "18+",                                            <--- Kube
    "gitVersion": "v1.18.3+012b3ec",
    "gitCommit": "012b3ec",
    "gitTreeState": "clean",
    "buildDate": "2020-07-24T07:23:10Z",
    "goVersion": "go1.13.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "releaseClientVersion": "4.5.0-0.nightly-2020-07-25-031342",
  "openshiftVersion": "4.5.0-0.nightly-2020-07-25-031342"
}


Additional info:

Comment 1 Maru Newby 2020-07-27 23:15:05 UTC
A slack conversation with Luke Meyer from ART revealed that the hyperkube binaries are built for release from a repo that doesn't have the same set of tags as openshift/kubernetes. This was previously worked around by a distgit script that expected a Godeps.json file [1], but that is broken by the move to go.mod. 

ART has agreed to take responsibility for the fix.

1: https://github.com/openshift/doozer/blob/a806878e56a34d4833c2ef8297a393c2a4b1316c/doozerlib/distgit.py#L1789-L1808

Comment 2 Maru Newby 2020-07-27 23:20:08 UTC
Jira issue: https://issues.redhat.com/browse/ART-2063

Comment 3 Maru Newby 2020-07-29 16:39:58 UTC
In addition to the reported failure mode, an incorrect server version will also prompt failure in some e2e tests hard-coded to check compatibility of the current kube version.

Comment 5 Travis Nielsen 2020-08-04 15:25:01 UTC
@Luke What is the timeline for the fix? 

OCS is blocked by this version issue, thus @Neha added a dependency. If we try to workaround this, we will just be peeling the onion to find all the issues until the version is fixed.

Comment 6 Travis Nielsen 2020-08-04 15:57:16 UTC
*** Bug 1865942 has been marked as a duplicate of this bug. ***

Comment 7 Dejan Bosanac 2020-08-05 09:25:35 UTC
This issue also affects AMQ Online team as we use different product features based on this value.

Comment 12 Neha Berry 2020-08-07 20:23:06 UTC
Could you share the nightly version containing the fix?

Comment 13 Ondrej Babec 2020-08-10 11:23:39 UTC
Hi, from just blind pick latest release I found that fix is already there so 4.6.0-0.nightly-2020-08-07-202945 or as it's today latest-4.6 contains that. None of this info is approved from devs but it's working...

Comment 14 Gaoyun Pei 2020-08-10 12:15:56 UTC
With 4.6.0-0.nightly-2020-08-10-110737, it shows the Kube version 1.19 now.

# oc version --output=json
{
  "clientVersion": {
    "major": "",
    "minor": "",
    "gitVersion": "4.6.0-202008031851.p0-a695d74",
    "gitCommit": "a695d74ef1aee9a3f605d38dd8b6fae2062b63fc",
    "gitTreeState": "clean",
    "buildDate": "2020-08-03T19:18:12Z",
    "goVersion": "go1.13.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "serverVersion": {
    "major": "1",
    "minor": "19+",
    "gitVersion": "v1.19.0-rc.2+5241b27-dirty",
    "gitCommit": "5241b27b8acd73cdc99a0cac281645189189f1d8",
    "gitTreeState": "dirty",
    "buildDate": "2020-08-06T08:12:07Z",
    "goVersion": "go1.14.4",
    "compiler": "gc",
    "platform": "linux/amd64"
  },
  "openshiftVersion": "4.6.0-0.nightly-2020-08-10-110737"
}

Comment 16 errata-xmlrpc 2020-10-27 16:17:21 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

Comment 17 errata-xmlrpc 2020-10-27 16:20:41 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