Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1420280

Summary: "--api-version" option doesn't take effect for "oc config set-cluster"
Product: OpenShift Container Platform Reporter: Yanping Zhang <yanpzhan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.0CC: aos-bugs, ffranz, hasha, jforrest, jokerman, mmccomas, smunilla, xiaocwan, xtian
Target Milestone: ---Keywords: Rebase
Target Release: ---   
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: 2017-08-10 05:17:28 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:

Description Yanping Zhang 2017-02-08 10:53:08 UTC
Description of problem:
When run "oc config set-cluster" with option "--api-version", the "--api-version" option doesn't take effect.

Version-Release number of selected component (if applicable):
oc v3.5.0.17+c55cf2b
kubernetes v1.5.2+43a9be4

How reproducible:
Always

Steps to Reproduce:
1. Set cluster with --api-version option:
$ oc config set-cluster cow-cluster --server=http://cow.org:8080 --api-version=v1
Cluster "cow-cluster" set.

2.Check the cluster in config:
$ oc config view


Actual results:
2.The api version is not set in the "cow-cluster" cluster:
$ oc config view
apiVersion: v1
clusters:
- cluster:
    server: http://cow.org:8080
  name: cow-cluster
- cluster:
    api-version: v1
    insecure-skip-tls-verify: true
    server: https://<mycluster>:8443
  name: <mycluster>
<--snip-->


Expected results:
2.Should have "api-version: v1" in cluster "cow-cluster"

Additional info:

Comment 1 Juan Vallejo 2017-02-08 15:24:57 UTC
Related upstream PR: https://github.com/kubernetes/kubernetes/pull/41139

Comment 2 Juan Vallejo 2017-03-24 22:51:57 UTC
Upstream PR merged. Bug will be fixed in the next rebase.

Comment 3 Fabiano Franz 2017-05-08 20:35:09 UTC
Fixed by the latest Kubernetes rebase.

Comment 5 shahan 2017-06-06 08:39:51 UTC
I checked the kubernetes PR 41139 is not rebased into latest Origin master yet (openshift v3.6.95 kubernetes v1.6.1+5115d708d7). So I changed to modified status, after the rebase is done please change back to ON_QA, Thanks!

Comment 6 Juan Vallejo 2017-06-12 14:43:56 UTC
https://github.com/kubernetes/kubernetes/pull/41139

Comment 7 Fabiano Franz 2017-06-27 22:22:55 UTC
Pull request that deprecates --api-version is in https://github.com/openshift/origin/pull/14919.

Comment 9 XiaochuanWang 2017-07-05 08:20:05 UTC
From PR https://github.com/openshift/origin/pull/14919, "--api-version" in oc config set-cluster is deprecated.

Tested on oc v3.6.133
kubernetes v1.6.1+5115d708d7
It works as PR design now:

# oc config view
apiVersion: v1
clusters:
- cluster:
    server: http://cow.org:8080
  name: cow-cluster
- cluster:
    insecure-skip-tls-verify: true
    server: https://xxx.com:8443
  name: xxx-com:8443
<--snip-->

This could be Verified.

Comment 11 errata-xmlrpc 2017-08-10 05:17:28 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/RHEA-2017:1716