Bug 1263562 - Switch oc login with a new user, the current-context should not use the last context namespace
Switch oc login with a new user, the current-context should not use the last ...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-16 03:49 EDT by Xingxing Xia
Modified: 2016-01-05 01:20 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:18:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xingxing Xia 2015-09-16 03:49:01 EDT
Description of problem:
Switch oc login with a new user, the current-context should not use the last context namespace

Version-Release number of selected component (if applicable):
openshift v1.0.6-37-gaece681
kubernetes v1.1.0-alpha.0-1605-g44c91b1
oc v1.0.6-37-gaece681

How reproducible:
Always

Steps to Reproduce:
1. Start openshift

2. login with user1 and create project
$ oc login
$ oc create new-project prj1

3. login with another new user user2
$ oc logout # (Optional. The actual result is the same)
$ oc login

4. check the current-context of the CLI configuration
$ oc config view

Actual results:
4.
See the context entry for user2:
- context:
    cluster: localhost:8443
    namespace: prj1
    user: user2/localhost:8443
  name: prj1/localhost:8443/user2

And current-context:
current-context: prj1/localhost:8443/user2

Expected results:
4.
The context entry for user2 should be:
- context:
    cluster: localhost:8443
    user: user2/localhost:8443
  name: /localhost:8443/user2

And current-context should be:
current-context: /localhost:8443/user2


Additional info:
Comment 1 openshift-github-bot 2015-10-12 11:10:56 EDT
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/44986a1ebb94754f1cae481d92933677e7c1667b
Bug 1263562 - users without projects should get default ctx when logging in
Comment 2 Fabiano Franz 2015-10-12 11:14:33 EDT
Fixed in master.
Comment 3 Xingxing Xia 2015-10-13 01:29:14 EDT
Verified in the version:
openshift/oc v1.0.6-532-g9c50059
kubernetes v1.1.0-alpha.1-653-g86b4e77

The issue is fixed.

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