Bug 2051626

Summary: kubectl version is not showing expected version details
Product: OpenShift Container Platform Reporter: Simon Reber <sreber>
Component: ocAssignee: Arda Guclu <aguclu>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aguclu, ehoxha, knarra, maszulik, mfojtik, nstamate, travi, wking
Version: 4.9   
Target Milestone: ---   
Target Release: 4.9.z   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2052980 (view as bug list) Environment:
Last Closed: 2022-06-09 06:41:53 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: 2044347    
Bug Blocks: 2052980, 2079325    

Description Simon Reber 2022-02-07 16:21:01 UTC
Description of problem:

When running kubectl from oc-4.9.18-linux.tar.gz (which is downloaded from https://access.redhat.com/downloads/content/290/ver=4.8/rhel---8/4.9.18/x86_64/product-software) we are seeing the following version details.

$ /tmp/kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v0.21.0-beta.1", GitCommit:"3f16530f0bb938bef95b705f6d235e29a892b176", GitTreeState:"clean", BuildDate:"2022-01-21T18:20:08Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3+e790d7f", GitCommit:"3a0f2c90b43e6cffd07f57b5b78dd9f083e47ee2", GitTreeState:"clean", BuildDate:"2021-12-14T02:10:38Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (0.21) and server (1.22) exceeds the supported minor version skew of +/-1

OpenShift Container Platform 4.9 is based on `kubernetes` 1.22 and therefore the `Client Version: version.Info{Major:"1", Minor:"21"` does not appear to be reported as expected (Minor is expected at 22 and not 21).

Further we are seeing `GitVersion:"v0.21.0-beta.1"` which does indicate that we might be using some Beta level software. This can be confusing to the customer and we should therefore evaluate whether this is correct or not and potentially fix this.

Version-Release number of selected component (if applicable):

 - OpenShift Container Platform 4.9

How reproducible:

 - Always

Steps to Reproduce:
1. Download the `oc.tar.gz` from https://access.redhat.com/downloads/content/290/ver=4.9/rhel---8/4.9.18/x86_64/product-software
2. Extract the `oc` and `kubectl` binary and run `kubectl version`

Actual results:

$ /tmp/kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v0.21.0-beta.1", GitCommit:"3f16530f0bb938bef95b705f6d235e29a892b176", GitTreeState:"clean", BuildDate:"2022-01-21T18:20:08Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3+e790d7f", GitCommit:"3a0f2c90b43e6cffd07f57b5b78dd9f083e47ee2", GitTreeState:"clean", BuildDate:"2021-12-14T02:10:38Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (0.21) and server (1.22) exceeds the supported minor version skew of +/-1

Expected results:

$ /tmp/kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"<something not beta>", GitCommit:"3f16530f0bb938bef95b705f6d235e29a892b176", GitTreeState:"clean", BuildDate:"2022-01-21T18:20:08Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3+e790d7f", GitCommit:"3a0f2c90b43e6cffd07f57b5b78dd9f083e47ee2", GitTreeState:"clean", BuildDate:"2021-12-14T02:10:38Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

Additional info:

Comment 4 RamaKasturi 2022-03-18 16:24:03 UTC
Moving the bug back to assigned as i see that the warning about "version difference between client and server"

[knarra@knarra openshift-client-linux-4.9.0-0.nightly-2022-03-18-014724]$ ./kubectl version 
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v0.22.6", GitCommit:"56e71258c8a50ea48592e57684ae3718d52855fa", GitTreeState:"clean", BuildDate:"2022-03-16T20:15:21Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5+5c84e52", GitCommit:"ce18cbe56f6e88a8fc0e06366afe113b415ad39b", GitTreeState:"clean", BuildDate:"2022-03-01T18:44:38Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (0.22) and server (1.22) exceeds the supported minor version skew of +/-1

Comment 5 Maciej Szulik 2022-04-15 14:14:22 UTC
*** Bug 2074836 has been marked as a duplicate of this bug. ***

Comment 6 Maciej Szulik 2022-04-15 14:15:35 UTC
Arda see what's wrong, maybe we need to have a different check in oc.

Comment 8 Arda Guclu 2022-04-18 11:40:10 UTC
@nikosst

Comment 10 Arda Guclu 2022-04-19 09:25:53 UTC
This PR https://github.com/openshift/oc/pull/1092 will fix that false positive warning message.

Comment 11 Arda Guclu 2022-04-27 11:48:52 UTC
I checked from the master after the referenced PR was merged and it correctly shows versions;

$ ./kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0-beta.0", GitCommit:"9b7fe72adea", GitTreeState:"clean", BuildDate:"2022-04-27T09:48:10Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3+d464c70", GitCommit:"6f5a5295923a614a4202a7ad274b38b69f9ca8c0", GitTreeState:"clean", BuildDate:"2022-04-21T11:47:02Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Thus, I'm moving this bug to verified.

Comment 12 RamaKasturi 2022-05-04 09:25:26 UTC
Hello Arda,

    Any reason you moved the bug directly to verified ? This is how the flow should be once developer sends a fix he should move the bug to POST and once merged into a build the bot will move the bug to ON_QA and once it is ON_QA , QE will move the bug to verified state. A bug should not directly move from POST to VERIFIED. Setting the bug back to POST, please move it to ON_QA if the fix has been merged already. 

Thanks
kasuri.

Comment 13 Arda Guclu 2022-05-05 10:10:27 UTC
Hello Rama,

This bug has been fixed by dump PR and that's why bugzilla did not automatically manage this. This is my mistake to move it directly to verified.

Since all the associated bugs are merged. I'm moving this to ON_QA.

Comment 14 zhou ying 2022-05-07 10:17:18 UTC
./kubectl version 
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0-beta.0", GitCommit:"42714a54660e095db22f57a9648c8ce132f38430", GitTreeState:"clean", BuildDate:"2022-05-06T22:42:53Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3+69213f8", GitCommit:"6f5a5295923a614a4202a7ad274b38b69f9ca8c0", GitTreeState:"clean", BuildDate:"2022-05-04T23:14:21Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 16 Maciej Szulik 2022-05-31 11:04:00 UTC
Fixing the version, since this should be pointing at 4.9

Comment 19 errata-xmlrpc 2022-06-09 06:41:53 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.9.37 bug fix update), 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-2022:4906