Bug 1899739

Summary: switching context looses token access and need to re-login again
Product: OpenShift Container Platform Reporter: Abhijeet Sadawarte <asadawar>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED DUPLICATE QA Contact: zhou ying <yinzhou>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.6CC: aos-bugs, jokerman, mfojtik
Target Milestone: ---   
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: 2020-11-20 15:07:23 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 Abhijeet Sadawarte 2020-11-19 21:34:29 UTC
Description of problem:

The cust is facing issues switching context from one cluster to another without having to log in again. It used to work fine on oc 4.4 and previous oc client but does not work with 4.5 or latest 4.6. 

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

How reproducible:
# oc login cluster1.example.com:6443 -u user -p password
Login successful
You have access to 20 projects, the list has been suppressed. You can list all projects with 'oc projects'
Using project "openshift-migration"

# oc login cluster2.example.com:6443 -u user -p password
Login successful
You have access to 30 projects, the list has been suppressed. You can list all projects with 'oc projects'
Using project "openshift-migration"

# oc config use-context openshift-migration/cluster1.example.com:6443/user
Switched to context "openshift-migration/cluster1.example.com:6443/user"

# oc get nodes
error: You must be logged in to the server (Unauthorized)


Actual results:

It looks like something may have changed.  It looks like in the 4.6 version of oc there is no cluster identifier associated with users whereas with 4.3 there is:

~~~
4.6:
- name: admin
  user:
    client-certificate-data: LS0t...Qo=
    client-key-data: LS0t...Qo=
- name: kube:admin
  user:
    token: sha256~mVBZWl4ODHoEnpVOSUYYtM7I82r9ya5ZtmtdGjvKIlc

4.3:
- name: kube:admin/api-rvanderp-vmc-devcluster-openshift-com:6443
  user:
    token: sha256~fw-MFoQEzrJZf8VukLJHDTKAi57Qc0MfkbC1RFoEu-c
- name: system:admin/api-rvanderp-vmc-devcluster-openshift-com:6443
  user:
    client-certificate-data: LS0t...Qo=
    client-key-data: LS0t...Qo=
~~~

Comment 1 Maciej Szulik 2020-11-20 15:07:23 UTC
This is already being backported pls follow https://bugzilla.redhat.com/show_bug.cgi?id=1891429

*** This bug has been marked as a duplicate of bug 1891429 ***

Comment 2 Maciej Szulik 2020-11-20 15:07:45 UTC
Actually 4.6 is being handled in https://bugzilla.redhat.com/show_bug.cgi?id=1891427

*** This bug has been marked as a duplicate of bug 1891427 ***