Bug 1899739 - switching context looses token access and need to re-login again
Summary: switching context looses token access and need to re-login again
Keywords:
Status: CLOSED DUPLICATE of bug 1891427
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-19 21:34 UTC by Abhijeet Sadawarte
Modified: 2024-03-25 17:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-20 15:07:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


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