{"action":"closed","number":17,"pull_request":{"url":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17","id":97641959,"html_url":"https://github.com/jupyterhub/kubespawner/pull/17","diff_url":"https://github.com/jupyterhub/kubespawner/pull/17.diff","patch_url":"https://github.com/jupyterhub/kubespawner/pull/17.patch","issue_url":"https://api.github.com/repos/jupyterhub/kubespawner/issues/17","number":17,"state":"closed","locked":false,"title":"Check for user being empty in context","user":{"login":"nnashok","id":10915339,"avatar_url":"https://avatars.githubusercontent.com/u/10915339?v=3","gravatar_id":"","url":"https://api.github.com/users/nnashok","html_url":"https://github.com/nnashok","followers_url":"https://api.github.com/users/nnashok/followers","following_url":"https://api.github.com/users/nnashok/following{/other_user}","gists_url":"https://api.github.com/users/nnashok/gists{/gist_id}","starred_url":"https://api.github.com/users/nnashok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnashok/subscriptions","organizations_url":"https://api.github.com/users/nnashok/orgs","repos_url":"https://api.github.com/users/nnashok/repos","events_url":"https://api.github.com/users/nnashok/events{/privacy}","received_events_url":"https://api.github.com/users/nnashok/received_events","type":"User","site_admin":false},"body":"The `kubectl` command puts in an empty user in the context causing the kubespawner to fail:\r\n```bash\r\nkubectl config set-context default-context --cluster=default-cluster\r\n```\r\n\r\nkubepsawner log:\r\n```\r\n    Traceback (most recent call last):\r\n      File \"/usr/lib/python3.4/site-packages/jupyterhub/app.py\", line 1524, in launch_instance_async\r\n        yield self.initialize(argv)\r\n      File \"/usr/lib/python3.4/site-packages/jupyterhub/app.py\", line 1315, in initialize\r\n        yield self.init_spawners()\r\n      File \"/usr/lib/python3.4/site-packages/jupyterhub/app.py\", line 1084, in init_spawners\r\n        self.users[orm_user.id] = user = User(orm_user, self.tornado_settings)\r\n      File \"/usr/lib/python3.4/site-packages/jupyterhub/user.py\", line 128, in __init__\r\n        config=self.settings.get('config'),\r\n      File \"/usr/lib/python3.4/site-packages/kubespawner/spawner.py\", line 32, in __init__\r\n        self.request = request_maker()\r\n      File \"/usr/lib/python3.4/site-packages/kubespawner/utils.py\", line 18, in request_maker\r\n        return request_maker_kubeconfig()\r\n      File \"/usr/lib/python3.4/site-packages/kubespawner/utils.py\", line 79, in request_maker_kubeconfig\r\n        user = [u for u in config['users'] if u['name'] == context['user']][0]['user']\r\n    IndexError: list index out of range\r\n```\r\n\r\n~/.kube/config:\r\n```yaml\r\napiVersion: v1\r\nclusters:\r\n- cluster:\r\n    server: http://127.0.0.1:8080\r\n  name: default-cluster\r\ncontexts:\r\n- context:\r\n    cluster: default-cluster\r\n    user: \"\"\r\n  name: default-context\r\ncurrent-context: default-context\r\nkind: Config\r\npreferences: {}\r\nusers: []\r\n```","created_at":"2016-12-12T21:56:51Z","updated_at":"2016-12-19T08:21:55Z","closed_at":"2016-12-19T08:21:55Z","merged_at":"2016-12-19T08:21:55Z","merge_commit_sha":"aaa35728e434039adb1d45d8246d17dfe01170da","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17/commits","review_comments_url":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17/comments","review_comment_url":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyterhub/kubespawner/issues/17/comments","statuses_url":"https://api.github.com/repos/jupyterhub/kubespawner/statuses/910f52df0ff81bd1f1ed8c752c1a8bfa29be10e6","head":{"label":"nnashok:empty-users","ref":"empty-users","sha":"910f52df0ff81bd1f1ed8c752c1a8bfa29be10e6","user":{"login":"nnashok","id":10915339,"avatar_url":"https://avatars.githubusercontent.com/u/10915339?v=3","gravatar_id":"","url":"https://api.github.com/users/nnashok","html_url":"https://github.com/nnashok","followers_url":"https://api.github.com/users/nnashok/followers","following_url":"https://api.github.com/users/nnashok/following{/other_user}","gists_url":"https://api.github.com/users/nnashok/gists{/gist_id}","starred_url":"https://api.github.com/users/nnashok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnashok/subscriptions","organizations_url":"https://api.github.com/users/nnashok/orgs","repos_url":"https://api.github.com/users/nnashok/repos","events_url":"https://api.github.com/users/nnashok/events{/privacy}","received_events_url":"https://api.github.com/users/nnashok/received_events","type":"User","site_admin":false},"repo":{"id":75984582,"name":"kubespawner","full_name":"nnashok/kubespawner","owner":{"login":"nnashok","id":10915339,"avatar_url":"https://avatars.githubusercontent.com/u/10915339?v=3","gravatar_id":"","url":"https://api.github.com/users/nnashok","html_url":"https://github.com/nnashok","followers_url":"https://api.github.com/users/nnashok/followers","following_url":"https://api.github.com/users/nnashok/following{/other_user}","gists_url":"https://api.github.com/users/nnashok/gists{/gist_id}","starred_url":"https://api.github.com/users/nnashok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnashok/subscriptions","organizations_url":"https://api.github.com/users/nnashok/orgs","repos_url":"https://api.github.com/users/nnashok/repos","events_url":"https://api.github.com/users/nnashok/events{/privacy}","received_events_url":"https://api.github.com/users/nnashok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nnashok/kubespawner","description":"Kubernetes spawner for JupyterHub","fork":true,"url":"https://api.github.com/repos/nnashok/kubespawner","forks_url":"https://api.github.com/repos/nnashok/kubespawner/forks","keys_url":"https://api.github.com/repos/nnashok/kubespawner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nnashok/kubespawner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nnashok/kubespawner/teams","hooks_url":"https://api.github.com/repos/nnashok/kubespawner/hooks","issue_events_url":"https://api.github.com/repos/nnashok/kubespawner/issues/events{/number}","events_url":"https://api.github.com/repos/nnashok/kubespawner/events","assignees_url":"https://api.github.com/repos/nnashok/kubespawner/assignees{/user}","branches_url":"https://api.github.com/repos/nnashok/kubespawner/branches{/branch}","tags_url":"https://api.github.com/repos/nnashok/kubespawner/tags","blobs_url":"https://api.github.com/repos/nnashok/kubespawner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nnashok/kubespawner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nnashok/kubespawner/git/refs{/sha}","trees_url":"https://api.github.com/repos/nnashok/kubespawner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nnashok/kubespawner/statuses/{sha}","languages_url":"https://api.github.com/repos/nnashok/kubespawner/languages","stargazers_url":"https://api.github.com/repos/nnashok/kubespawner/stargazers","contributors_url":"https://api.github.com/repos/nnashok/kubespawner/contributors","subscribers_url":"https://api.github.com/repos/nnashok/kubespawner/subscribers","subscription_url":"https://api.github.com/repos/nnashok/kubespawner/subscription","commits_url":"https://api.github.com/repos/nnashok/kubespawner/commits{/sha}","git_commits_url":"https://api.github.com/repos/nnashok/kubespawner/git/commits{/sha}","comments_url":"https://api.github.com/repos/nnashok/kubespawner/comments{/number}","issue_comment_url":"https://api.github.com/repos/nnashok/kubespawner/issues/comments{/number}","contents_url":"https://api.github.com/repos/nnashok/kubespawner/contents/{+path}","compare_url":"https://api.github.com/repos/nnashok/kubespawner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nnashok/kubespawner/merges","archive_url":"https://api.github.com/repos/nnashok/kubespawner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nnashok/kubespawner/downloads","issues_url":"https://api.github.com/repos/nnashok/kubespawner/issues{/number}","pulls_url":"https://api.github.com/repos/nnashok/kubespawner/pulls{/number}","milestones_url":"https://api.github.com/repos/nnashok/kubespawner/milestones{/number}","notifications_url":"https://api.github.com/repos/nnashok/kubespawner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nnashok/kubespawner/labels{/name}","releases_url":"https://api.github.com/repos/nnashok/kubespawner/releases{/id}","deployments_url":"https://api.github.com/repos/nnashok/kubespawner/deployments","created_at":"2016-12-08T23:45:46Z","updated_at":"2016-12-08T23:45:48Z","pushed_at":"2016-12-12T21:52:09Z","git_url":"git://github.com/nnashok/kubespawner.git","ssh_url":"git@github.com:nnashok/kubespawner.git","clone_url":"https://github.com/nnashok/kubespawner.git","svn_url":"https://github.com/nnashok/kubespawner","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyterhub:master","ref":"master","sha":"ee306b510b3bc820f1849a72d9e4a867b84a8387","user":{"login":"jupyterhub","id":17927519,"avatar_url":"https://avatars.githubusercontent.com/u/17927519?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyterhub","html_url":"https://github.com/jupyterhub","followers_url":"https://api.github.com/users/jupyterhub/followers","following_url":"https://api.github.com/users/jupyterhub/following{/other_user}","gists_url":"https://api.github.com/users/jupyterhub/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterhub/subscriptions","organizations_url":"https://api.github.com/users/jupyterhub/orgs","repos_url":"https://api.github.com/users/jupyterhub/repos","events_url":"https://api.github.com/users/jupyterhub/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterhub/received_events","type":"Organization","site_admin":false},"repo":{"id":46604988,"name":"kubespawner","full_name":"jupyterhub/kubespawner","owner":{"login":"jupyterhub","id":17927519,"avatar_url":"https://avatars.githubusercontent.com/u/17927519?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyterhub","html_url":"https://github.com/jupyterhub","followers_url":"https://api.github.com/users/jupyterhub/followers","following_url":"https://api.github.com/users/jupyterhub/following{/other_user}","gists_url":"https://api.github.com/users/jupyterhub/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterhub/subscriptions","organizations_url":"https://api.github.com/users/jupyterhub/orgs","repos_url":"https://api.github.com/users/jupyterhub/repos","events_url":"https://api.github.com/users/jupyterhub/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterhub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyterhub/kubespawner","description":"Kubernetes spawner for JupyterHub","fork":false,"url":"https://api.github.com/repos/jupyterhub/kubespawner","forks_url":"https://api.github.com/repos/jupyterhub/kubespawner/forks","keys_url":"https://api.github.com/repos/jupyterhub/kubespawner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyterhub/kubespawner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyterhub/kubespawner/teams","hooks_url":"https://api.github.com/repos/jupyterhub/kubespawner/hooks","issue_events_url":"https://api.github.com/repos/jupyterhub/kubespawner/issues/events{/number}","events_url":"https://api.github.com/repos/jupyterhub/kubespawner/events","assignees_url":"https://api.github.com/repos/jupyterhub/kubespawner/assignees{/user}","branches_url":"https://api.github.com/repos/jupyterhub/kubespawner/branches{/branch}","tags_url":"https://api.github.com/repos/jupyterhub/kubespawner/tags","blobs_url":"https://api.github.com/repos/jupyterhub/kubespawner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyterhub/kubespawner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyterhub/kubespawner/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyterhub/kubespawner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyterhub/kubespawner/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyterhub/kubespawner/languages","stargazers_url":"https://api.github.com/repos/jupyterhub/kubespawner/stargazers","contributors_url":"https://api.github.com/repos/jupyterhub/kubespawner/contributors","subscribers_url":"https://api.github.com/repos/jupyterhub/kubespawner/subscribers","subscription_url":"https://api.github.com/repos/jupyterhub/kubespawner/subscription","commits_url":"https://api.github.com/repos/jupyterhub/kubespawner/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyterhub/kubespawner/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyterhub/kubespawner/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyterhub/kubespawner/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyterhub/kubespawner/contents/{+path}","compare_url":"https://api.github.com/repos/jupyterhub/kubespawner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyterhub/kubespawner/merges","archive_url":"https://api.github.com/repos/jupyterhub/kubespawner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyterhub/kubespawner/downloads","issues_url":"https://api.github.com/repos/jupyterhub/kubespawner/issues{/number}","pulls_url":"https://api.github.com/repos/jupyterhub/kubespawner/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyterhub/kubespawner/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyterhub/kubespawner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyterhub/kubespawner/labels{/name}","releases_url":"https://api.github.com/repos/jupyterhub/kubespawner/releases{/id}","deployments_url":"https://api.github.com/repos/jupyterhub/kubespawner/deployments","created_at":"2015-11-21T07:02:52Z","updated_at":"2016-11-19T20:59:51Z","pushed_at":"2016-12-19T08:21:55Z","git_url":"git://github.com/jupyterhub/kubespawner.git","ssh_url":"git@github.com:jupyterhub/kubespawner.git","clone_url":"https://github.com/jupyterhub/kubespawner.git","svn_url":"https://github.com/jupyterhub/kubespawner","homepage":null,"size":82,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":6,"forks":14,"open_issues":6,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17"},"html":{"href":"https://github.com/jupyterhub/kubespawner/pull/17"},"issue":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/issues/17"},"comments":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/jupyterhub/kubespawner/statuses/910f52df0ff81bd1f1ed8c752c1a8bfa29be10e6"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"yuvipanda","id":30430,"avatar_url":"https://avatars.githubusercontent.com/u/30430?v=3","gravatar_id":"","url":"https://api.github.com/users/yuvipanda","html_url":"https://github.com/yuvipanda","followers_url":"https://api.github.com/users/yuvipanda/followers","following_url":"https://api.github.com/users/yuvipanda/following{/other_user}","gists_url":"https://api.github.com/users/yuvipanda/gists{/gist_id}","starred_url":"https://api.github.com/users/yuvipanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuvipanda/subscriptions","organizations_url":"https://api.github.com/users/yuvipanda/orgs","repos_url":"https://api.github.com/users/yuvipanda/repos","events_url":"https://api.github.com/users/yuvipanda/events{/privacy}","received_events_url":"https://api.github.com/users/yuvipanda/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"yuvipanda"}}