Bug 2079325

Summary: kubectl version is not showing expected version details
Product: OpenShift Container Platform Reporter: Arda Guclu <aguclu>
Component: ocAssignee: Maciej Szulik <maszulik>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: mfojtik
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-11 10:31:49 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: 2051626    
Bug Blocks:    

Description Arda Guclu 2022-04-27 11:58:10 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 1 zhou ying 2022-04-29 13:39:54 UTC
Cloned the pr , and checked , the issue has fixed :

 ./kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"f5bd0b0c0", GitTreeState:"clean", BuildDate:"2022-04-29T13:27:52Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5+b463d71", GitCommit:"3c28e7a79b58e78b4c1dc1ab7e5f6c6c2d3aedd3", GitTreeState:"clean", BuildDate:"2022-04-27T00:35:47Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 5 zhou ying 2022-05-05 01:53:50 UTC
./kubectl version 
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"09f825e2ac8ddedf8bbc6bc82ffc5520560788a0", GitTreeState:"clean", BuildDate:"2022-04-29T17:13:31Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5+b463d71", GitCommit:"3c28e7a79b58e78b4c1dc1ab7e5f6c6c2d3aedd3", GitTreeState:"clean", BuildDate:"2022-04-27T00:35:47Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 8 errata-xmlrpc 2022-05-11 10:31:49 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.10.13 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:1690