Bug 1788194 - [oc-cli]oc-config command does not work with `--kubeconfig`
Summary: [oc-cli]oc-config command does not work with `--kubeconfig`
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.2.z
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks: 1789857 1789869
TreeView+ depends on / blocked
 
Reported: 2020-01-06 16:44 UTC by Hongkai Liu
Modified: 2020-05-04 11:23 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1789857 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:22:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 246 0 None closed Bug 1788194: allow --config and --kubeconfig 2020-12-09 15:57:06 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-04 11:23:09 UTC

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


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