Description of problem:
When performing `oc login` the options --cluster and --context are ignored. One has to first do `oc config use-context` and then `oc login`. Once logged it, the cluster and context options work for other commands.
I think this is inconsistent and inconvenient.
As a user I'd expect to be able to perform `oc login` with one of those commands. Then default context should be changed to the one used for login. Or even if default context is not switched, then that would be better than having to switch contexts just to be able to login.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. setup ~/.kube/config with 2 clusters
2. oc login --context=not-current-context
login is performed against current context instead of the specified context on command line
login is performed against the server/context specified on command line
Related PR: https://github.com/openshift/origin/pull/12859
Per Jordan's comment here , commands such as `oc project` are meant to be used to address the case of a user wanting to switch to a different context / cluster.
It is not the intent of `oc login` to allow the user to manually manage contexts.
Any reason to not make it easier for the user to actually use different clusters/contexts?
As a user of multiple environments I can tell you that it is a great PITA to do so. I need to remember cluster hostname, project and username I'm using on each cluster. With the ability to have shorter mnemonic contexts, it is much more manageable.
That's why I filed the original bugzilla - because I find it hardly usable.
I don't care whether the tool was originally meant to allow certain usage. I'm proposing to make it more useful for multi-cluster use cases based on my experience using that tool. It is disappointing to see the request closed without a logical reason why it is a bad idea. Moreover there is a related pull request already.