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

Bug 1788194

Summary: [oc-cli]oc-config command does not work with `--kubeconfig`
Product: OpenShift Container Platform Reporter: Hongkai Liu <hongkliu>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: aos-bugs, hongkliu, jokerman, mfojtik, scuppett
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1789857 (view as bug list) Environment:
Last Closed: 2020-05-04 11:22:33 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: 1789857, 1789869    

Description Hongkai Liu 2020-01-06 16:44:58 UTC
Description of problem:


Version-Release number of selected component (if applicable):
~ oc version --client
Client Version: v4.2.11

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
https://coreos.slack.com/archives/CEKNRGF25/p1578065888081000

David Eads  39 minutes ago
--kubeconfig should work.  If it does not work, that is a bug

David Eads  40 minutes ago
--config  is required for backward compatibility. @maszulik I think you can deprecate and hide it now, but leave it in place


Additional info:


➜  ~ mv ~/.kube/config /tmp/tmp.config

➜  ~ oc --kubeconfig /tmp/tmp.config config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

### --config works
➜  ~ oc --config /tmp/tmp.config config view
apiVersion: v1
clusters:
- cluster:
    server: https://api.ci.openshift.org:443
  name: api-ci-openshift-org:443
contexts:
- context:
    cluster: api-ci-openshift-org:443
    namespace: default
    user: hongkailiu/api-ci-openshift-org:443
  name: default/api-ci-openshift-org:443/hongkailiu
...

Comment 3 zhou ying 2020-01-10 02:17:03 UTC
Confirmed with latest oc client, the issue has fixed:
[zhouying@dhcp-140-138 test-bugs]$ rpm -q openshift-clients
openshift-clients-4.4.0-202001091623.git.1.670f92e.el7.x86_64

[zhouying@dhcp-140-138 test-bugs]$  oc config view
apiVersion: v1
clusters: null
contexts: null
current-context: ""
kind: Config
preferences: {}
users: null
[zhouying@dhcp-140-138 test-bugs]$ oc --kubeconfig /tmp/config.tmp config view 
apiVersion: v1
clusters:
- cluster:
    server: https://xxxxx:443
  name: xxxxxx:443
- cluster:
    insecure-skip-tls-verify: true
    server: https://yyyyy:6443
  name: yyyyy:6443
....

Comment 5 errata-xmlrpc 2020-05-04 11:22:33 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/RHBA-2020:0581