{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66435","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66435/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66435/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66435/events","html_url":"https://github.com/kubernetes/kubernetes/issues/66435","id":343027783,"node_id":"MDU6SXNzdWUzNDMwMjc3ODM=","number":66435,"title":"kubectl fails when duplicate context names are present","user":{"login":"scriptonist","id":8335904,"node_id":"MDQ6VXNlcjgzMzU5MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/8335904?v=4","gravatar_id":"","url":"https://api.github.com/users/scriptonist","html_url":"https://github.com/scriptonist","followers_url":"https://api.github.com/users/scriptonist/followers","following_url":"https://api.github.com/users/scriptonist/following{/other_user}","gists_url":"https://api.github.com/users/scriptonist/gists{/gist_id}","starred_url":"https://api.github.com/users/scriptonist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriptonist/subscriptions","organizations_url":"https://api.github.com/users/scriptonist/orgs","repos_url":"https://api.github.com/users/scriptonist/repos","events_url":"https://api.github.com/users/scriptonist/events{/privacy}","received_events_url":"https://api.github.com/users/scriptonist/received_events","type":"User","site_admin":false},"labels":[{"id":617149945,"node_id":"MDU6TGFiZWw2MTcxNDk5NDU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-sig","name":"needs-sig","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-20T09:01:26Z","updated_at":"2018-07-20T09:01:27Z","closed_at":null,"author_association":"NONE","body":"<!-- This form is for bug reports and feature requests ONLY!\r\n\r\nIf you're looking for help check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).\r\n\r\nIf the matter is security related, please disclose it privately via https://kubernetes.io/security/.\r\n-->\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n /kind bug\r\n\r\n\r\n**What happened**:\r\nI brought up an AKS cluster with name `testcluster`.Then  ran azure-cli command  `az aks get-credentials` to set the current `kubectl` context to point to the new cluster.The command ran successfully.\r\nNow on running `kubectl get nodes`, I was greeted with the following error\r\n```\r\n$ kubectl get nodes \r\nerror: Error loading config file \"/home/atom/.kube/config\": error converting *[]NamedCluster into *map[string]*api.Cluster: duplicate name \"testcluster\" in list [{\r\n...\r\n...\r\n 55 73 75 10 45 45 45 45 45 69 78 68 32 67 69 82 84 73 70 73 67 65 84 69 45 45 45 45 45 10] []}}]\r\n```\r\n\r\n**What you expected to happen**:\r\n\r\nExpected `kubectl` to use the current cluster context and run the command.\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\nI believe this was caused because contexts with the same name are exists. So testing in such an environment can bringup this issue.\r\n\r\n**Anything else we need to know?**:\r\nWhen this bug happens, we can't run any other commands. I believe this bug exists in a post run hook.If this bug is valid I will be happy to work on a PR.\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\n```\r\nClient Version: version.Info{Major:\"1\", Minor:\"11\", GitVersion:\"v1.11.1\", GitCommit:\"b1b29978270dc22fecc592ac55d903350454310a\", GitTreeState:\"clean\", BuildDate:\"2018-07-17T18:53:20Z\", GoVersion:\"go1.10.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"9\", GitVersion:\"v1.9.9\", GitCommit:\"57729ea3d9a1b75f3fc7bbbadc597ba707d47c8a\", GitTreeState:\"clean\", BuildDate:\"2018-06-29T01:07:01Z\", GoVersion:\"go1.9.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n\r\n```\r\n- Cloud provider or hardware configuration:\r\nAzure AKS\r\n- OS (e.g. from /etc/os-release):\r\n```\r\nNAME=\"Ubuntu\"\r\nVERSION=\"18.04 LTS (Bionic Beaver)\"\r\nID=ubuntu\r\nID_LIKE=debian\r\nPRETTY_NAME=\"Ubuntu 18.04 LTS\"\r\nVERSION_ID=\"18.04\"\r\nHOME_URL=\"https://www.ubuntu.com/\"\r\nSUPPORT_URL=\"https://help.ubuntu.com/\"\r\nBUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\r\nPRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\r\nVERSION_CODENAME=bionic\r\nUBUNTU_CODENAME=bionic\r\n```\r\n- Kernel (e.g. `uname -a`):\r\n`Linux drogon 4.15.0-24-generic #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux`\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/406536802","html_url":"https://github.com/kubernetes/kubernetes/issues/66435#issuecomment-406536802","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/66435","id":406536802,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjUzNjgwMg==","user":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T09:01:27Z","updated_at":"2018-07-20T09:01:27Z","author_association":"COLLABORATOR","body":"@scriptonist: There are no sig labels on this issue. Please add a sig label.\n\n<details>\n\nA sig label can be added by either:\n\n1. mentioning a sig: `@kubernetes/sig-<group-name>-<group-suffix>`\n    e.g., `@kubernetes/sig-contributor-experience-<group-suffix>` to notify the contributor experience sig, OR\n\n2. specifying the label manually: `/sig <group-name>`\n    e.g., `/sig scalability` to apply the `sig/scalability` label\n\nNote: Method 1 will trigger an email to the group. See the [group list](https://git.k8s.io/community/sig-list.md).\nThe `<group-suffix>` in method 1 has to be replaced with one of these: _**bugs, feature-requests, pr-reviews, test-failures, proposals**_\n\nInstructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.\n</details>"}}
{"actor":{"display_login":"k8s-ci-robot"}}