Bug 1963784 - oc project not works with cluster proxy
Summary: oc project not works with cluster proxy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.z
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On: 1944581
Blocks: 1973613
TreeView+ depends on / blocked
 
Reported: 2021-05-24 03:10 UTC by OpenShift BugZilla Robot
Modified: 2021-07-06 11:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Not all options from config were copied when switching projects. Consequence: When using proxy through Exec configuration in kubeconfig that information was lost during project switch. Fix: Copy all the necessary information when switching projects. Result: oc project works when using proxy.
Clone Of:
: 1973613 (view as bug list)
Environment:
Last Closed: 2021-07-06 11:38:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 861 0 None open [release-4.7] Bug 1963784: Preserve AuthInfo when switching projects 2021-06-18 10:34:15 UTC
Red Hat Product Errata RHBA-2021:2554 0 None None None 2021-07-06 11:39:14 UTC

Comment 4 zhou ying 2021-06-25 07:54:00 UTC
Checked with the latest oc client, the issue has fixed:

[root@localhost ~]#  oc projects
You have access to the following projects and can switch between them with ' project <projectname>':

    zhouyt
  * zhouyt2

Using project "zhouyt2" on server "https://api.jwei.qe.devcluster.openshift.com:6443".
[root@localhost ~]#  oc project zhouyt
Now using project "zhouyt" on server "https://api.jwei.qe.devcluster.openshift.com:6443".
[root@localhost ~]# cat /root/.kube/config 
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://api.jwei.qe.devcluster.openshift.com:6443
  name: api-jwei-qe-devcluster-openshift-com:6443
contexts:
- context:
    cluster: api-jwei-qe-devcluster-openshift-com:6443
    user: testuser-39/api-jwei-qe-devcluster-openshift-com:6443
  name: /api-jwei-qe-devcluster-openshift-com:6443/testuser-39
- context:
    cluster: api-jwei-qe-devcluster-openshift-com:6443
    namespace: zhouyt
    user: testuser-39/api-jwei-qe-devcluster-openshift-com:6443
  name: zhouyt/api-jwei-qe-devcluster-openshift-com:6443/testuser-39
- context:
    cluster: api-jwei-qe-devcluster-openshift-com:6443
    namespace: zhouyt2
    user: testuser-39/api-jwei-qe-devcluster-openshift-com:6443
  name: zhouyt2/api-jwei-qe-devcluster-openshift-com:6443/testuser-39
current-context: zhouyt/api-jwei-qe-devcluster-openshift-com:6443/testuser-39
kind: Config
preferences: {}
users:
- name: testuser-39/api-jwei-qe-devcluster-openshift-com:6443
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - /root/.kube/my-token
      command: bash
      env: null
      provideClusterInfo: false
[root@localhost ~]# oc version --client 
Client Version: 4.7.0-202106232349.p0.git.3ac4b96-3ac4b96

Comment 7 errata-xmlrpc 2021-07-06 11:38:38 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.7.19 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-2021:2554


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