context name not set correctly (k8s)

Bug #1812873 reported by Yannic Ahrens
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-magnumclient
New
Undecided
Unassigned

Bug Description

In the configuration fetched from a spawned kubernetes cluster, the context name is set to "default" (see [0]). This causes problems when managing multiple clusters because of name collisions. When I set KUBECONFIG to point to multiple cluster config files only the first context in that list is noticed by kubectl.

$ export KUBECONFIG=$HOME/config-c1:$HOME/config-c2
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* default c1 admin

Proposed solution:

Include the cluster name in the context name. Perhaps just use the cluster name as context name as done in [1].

[0]: https://github.com/openstack/python-magnumclient/blob/master/magnumclient/common/utils.py#L206
[1]: https://github.com/openstack/python-magnumclient/blob/master/magnumclient/common/utils.py#L188

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.