Bug 1353355 - RFE: Show Master Version in the Output of oc version
Summary: RFE: Show Master Version in the Output of oc version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.1
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.3.1
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-06 21:49 UTC by Nick Schuetz
Modified: 2019-11-21 18:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Display master version in oc version Reason: To be able to easily tell what version master is on. Result: oc version prints master version.
Clone Of:
Environment:
Last Closed: 2019-11-21 18:37:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nick Schuetz 2016-07-06 21:49:35 UTC
Description of problem:
oc version shows the version of oc and kubernetes. It does not show the version of OpenShift the master is running. It would be nice if the user could tell which version of OpenShift is running on the server side similar to what's provided by the web console in the About section.

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

How reproducible:
Everytime

Steps to Reproduce:
1. Run: oc version
2.
3.

Actual results:
oc v3.2.1.4-1-g1864c8f
kubernetes v1.2.0-36-g4a3f9c5


Expected results:
OpenShift Master v3.2.1.4-1-g1864c8f
oc v3.2.1.4-1-g1864c8f
kubernetes v1.2.0-36-g4a3f9c5


Additional info:

Knowing what version your master is running can be useful when understanding what features are possibly available and supported in a given installation. It can also aid you in deciding what client you should be running.

Comment 1 Juan Vallejo 2016-07-11 22:38:42 UTC
Related PR: https://github.com/openshift/origin/pull/9785

Comment 2 Liang Xia 2016-08-01 08:26:36 UTC
Running the command on MASTER, it outputs
# openshift version
openshift v3.3.0.12
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

Server https://master-server-url:8443
OpenShift v3.3.0.12
Kubernetes v1.3.0+57fb9ac


Is it expected ?

Comment 3 Xingxing Xia 2016-08-01 09:25:44 UTC
Another confusion: `oc version` sometimes gives error:
error: server took too long to respond with version information

Other times gives error (against old server not supporting this API):
Error from server: User "xxia" cannot "get" on "/version/openshift"

Other times gives error (against not existing host. E.g. the cluster in ~/.kube/config is down):
Unable to connect to the server: dial tcp <not existing host>:8443: getsockopt: no route to host

As a user, he may not always want to check server version via `oc version`. Many times, he may just want to check LOCAL oc version. Afraid the above errors (and response timeout) might make user feel not well.

How about implementing the feature via flag? E.g. --get-server-version[=false], if user really wants to check server version, he could explicitly run `oc version --get-server-version`, otherwise, `oc version` just shows local oc version.

Comment 4 Juan Vallejo 2016-08-01 13:19:21 UTC
> Running the command on MASTER, it outputs
> # openshift version
> openshift v3.3.0.12
> kubernetes v1.3.0+57fb9ac
> etcd 2.3.0+git
>
> Server https://master-server-url:8443
> OpenShift v3.3.0.12
> Kubernetes v1.3.0+57fb9ac
>
>
> Is it expected ?

Thanks for catching this, it has been addressed in this PR: https://github.com/openshift/origin/pull/10093

> Another confusion: `oc version` sometimes gives error:
> error: server took too long to respond with version information

Yes, this is working as expected, there is a 10 second timeout so that the command does not hang for too long.

> Other times gives error (against old server not supporting this API):
> Error from server: User "xxia" cannot "get" on "/version/openshift"

This has also been addressed in the PR mentioned above.

> Other times gives error (against not existing host. E.g. the cluster in ~/.kube/config is down):
> Unable to connect to the server: dial tcp <not existing host>:8443: getsockopt: no route to host

I will update the PR (https://github.com/openshift/origin/pull/10093) to handle this.

Comment 5 Xingxing Xia 2016-09-18 05:30:03 UTC
Seems works well now and could be moved to ON_QA and then VERIFIED by QE

Comment 6 Liang Xia 2017-09-27 07:20:16 UTC
This one should have been fixed for a long time.

$ oc version
oc v3.7.0-0.127.0
kubernetes v1.7.0+80709908fd
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://my-server:443
openshift v3.6.173.0.21
kubernetes v1.6.1+5115d708d7

Comment 7 Xingxing Xia 2017-09-27 07:39:08 UTC
Right, thanks, I'd like to move it to VERIFIED directly


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