{"action":"created","comment":{"url":"https://api.github.com/repos/ncdc/kubernetes/pulls/comments/39814284","id":39814284,"diff_hunk":"@@ -188,6 +195,114 @@ var _ = Describe(\"Kubectl client\", func() {\n \t\t\tif e, a := \"hi\", execOutput; e != a {\n \t\t\t\tFailf(\"Unexpected kubectl exec output. Wanted %q, got %q\", e, a)\n \t\t\t}\n+\n+\t\t\tBy(\"executing a command in the container through an HTTP proxy\")\n+\t\t\t// Start by checking for the environment variable before anything else\n+\t\t\tkubectlBinPath := os.Getenv(\"KUBECTLBIN\")\n+\t\t\t// Fail if the variable isn't set\n+\t\t\tif kubectlBinPath == \"\" {\n+\t\t\t\tFailf(\"KUBECTLBIN environment variable must be set to the full path of the kubectl binary\")\n+\t\t\t}\n+\n+\t\t\tapiserverAddr := os.Getenv(\"APISERVERADDR\")\n+\t\t\t// Fail if the variable isn't set\n+\t\t\tif apiserverAddr == \"\" {\n+\t\t\t\tFailf(\"APISERVERADDR environment variable must be set to the full address to the api server\")\n+\t\t\t}\n+\n+\t\t\t// start the proxy container\n+\t\t\tgoproxyPodPath := filepath.Join(testContext.RepoRoot, \"test/images/goproxy/pod.yaml\")\n+\t\t\trunKubectl(\"create\", \"-f\", goproxyPodPath, fmt.Sprintf(\"--namespace=%v\", ns))\n+\n+\t\t\t// start exec-proxy-tester container\n+\t\t\tnetexecPodPath := filepath.Join(testContext.RepoRoot, \"contrib/for-tests/netexec/pod.yaml\")\n+\t\t\trunKubectl(\"create\", \"-f\", netexecPodPath, fmt.Sprintf(\"--namespace=%v\", ns))\n+\t\t\tcheckPodsRunningReady(c, ns, []string{goproxyContainer, netexecContainer}, podStartTimeout)\n+\n+\t\t\t// get the proxy address\n+\t\t\tgoproxyPod, err := c.Pods(ns).Get(goproxyContainer)\n+\t\t\tif err != nil {\n+\t\t\t\tFailf(\"Unable to get the goproxy pod. Error: %s\", err)\n+\t\t\t}\n+\t\t\tproxyAddr := fmt.Sprintf(\"http://%s:8080\", goproxyPod.Status.PodIP)\n+\t\t\t// get the exec address\n+\t\t\tnetexecPod, err := c.Pods(ns).Get(netexecContainer)\n+\t\t\tnetexecAddr := fmt.Sprintf(\"http://%s:8080\", netexecPod.Status.PodIP)\n+\n+\t\t\t// upload kubectl to remote exec server\n+\t\t\tpostBodyBuffer := &bytes.Buffer{}\n+\t\t\tpostBodyWriter := multipart.NewWriter(postBodyBuffer)\n+\n+\t\t\t// Set up the form file\n+\t\t\tfileWriter, err := postBodyWriter.CreateFormFile(\"file\", \"kubectl\")\n+\t\t\tif err != nil {\n+\t\t\t\tFailf(\"Unable to to write kubectl at %s to buffer. Error: %s\", kubectlBinPath, err)\n+\t\t\t}\n+\n+\t\t\t// Open up the kubectl binary for reading\n+\t\t\tfh, err := os.Open(kubectlBinPath)\n+\t\t\tif err != nil {\n+\t\t\t\tFailf(\"Unable to to access kubectl at %s. Error: %s\", kubectlBinPath, err)\n+\t\t\t}\n+\n+\t\t\t// Copy kubectl binary into the file writer\n+\t\t\t_, err = io.Copy(fileWriter, fh)\n+\t\t\tif err != nil {\n+\t\t\t\tFailf(\"Unable to to copy kubectl at %s into the file writer. Error: %s\", kubectlBinPath, err)\n+\t\t\t}\n+\t\t\t// Nothing more should be written to this instance of the postBodyWriter\n+\t\t\tpostBodyWriter.Close()\n+","path":"test/e2e/kubectl.go","position":117,"original_position":117,"commit_id":"b79bc657c89cce046460b402b5faf128b0377ef9","original_commit_id":"b79bc657c89cce046460b402b5faf128b0377ef9","user":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"body":"Add a `By` indicating you're uploading","created_at":"2015-09-18T00:19:29Z","updated_at":"2015-09-18T00:19:29Z","html_url":"https://github.com/ncdc/kubernetes/pull/4#discussion_r39814284","pull_request_url":"https://api.github.com/repos/ncdc/kubernetes/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/comments/39814284"},"html":{"href":"https://github.com/ncdc/kubernetes/pull/4#discussion_r39814284"},"pull_request":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/ncdc/kubernetes/pulls/4","id":45337351,"html_url":"https://github.com/ncdc/kubernetes/pull/4","diff_url":"https://github.com/ncdc/kubernetes/pull/4.diff","patch_url":"https://github.com/ncdc/kubernetes/pull/4.patch","issue_url":"https://api.github.com/repos/ncdc/kubernetes/issues/4","number":4,"state":"open","locked":false,"title":"Add e2e testing to spdy proxy support using netexec","user":{"login":"ashcrow","id":22706,"avatar_url":"https://avatars.githubusercontent.com/u/22706?v=3","gravatar_id":"","url":"https://api.github.com/users/ashcrow","html_url":"https://github.com/ashcrow","followers_url":"https://api.github.com/users/ashcrow/followers","following_url":"https://api.github.com/users/ashcrow/following{/other_user}","gists_url":"https://api.github.com/users/ashcrow/gists{/gist_id}","starred_url":"https://api.github.com/users/ashcrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashcrow/subscriptions","organizations_url":"https://api.github.com/users/ashcrow/orgs","repos_url":"https://api.github.com/users/ashcrow/repos","events_url":"https://api.github.com/users/ashcrow/events{/privacy}","received_events_url":"https://api.github.com/users/ashcrow/received_events","type":"User","site_admin":false},"body":"Verified using ginkgo against a local cluster as originally discussed. This supersedes #3.\r\n\r\n## Changes\r\n* rebased on kubernetes/master (hence the non automatic merge)\r\n* https://github.com/ncdc/kubernetes/commit/2b4dcdf08b31c46992a4411841d6e854911ad292: url.URL.Host now canonical before use in spdy roundtripper \r\n* https://github.com/ncdc/kubernetes/commit/c7b1a48e7c80d1c74d6953bf6c0e28bafb939e91: Fixes netexec Makefiles TAG variable: \r\n* https://github.com/ncdc/kubernetes/commit/9e4ef014ca491693f7a8b845fe323e75516fe335\r\n  * Adds upload functionality\r\n  * Adds EXPOSE to the Dockerfile\r\n* https://github.com/ncdc/kubernetes/commit/704e1a08566524b008ad6790023d6399b645964b: Adds a pod.yaml for netexec\r\n* https://github.com/ncdc/kubernetes/commit/017d11ef17ff83539ac8dbe72c65141f9f476f79: Adds more logging for shell handler: \r\n* https://github.com/ncdc/kubernetes/commit/f53d5cab6805d35e643b0f7d939cd744919ca48b\r\n  * pod file for goproxy added \r\n  * EXPOSE added to Dockerfile\r\n* https://github.com/ncdc/kubernetes/commit/b79bc657c89cce046460b402b5faf128b0377ef9: e2e updates in ```test/e2e/kubectl.go``` to enable testing: \r\n\r\n## Notes\r\ne2e requires two new environment variables.\r\n* ```KUBECTLBIN```: The full path to a *static* ```kubectl``` binary\r\n* ```APISERVERADDR```: Full URL to the API server (IE: http://10.10.10.10:8080). This is fed in to the exec-proxy-test pod as its ```kubectl --server``` option.","created_at":"2015-09-17T20:24:35Z","updated_at":"2015-09-18T00:19:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ncdc/kubernetes/pulls/4/commits","review_comments_url":"https://api.github.com/repos/ncdc/kubernetes/pulls/4/comments","review_comment_url":"https://api.github.com/repos/ncdc/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ncdc/kubernetes/issues/4/comments","statuses_url":"https://api.github.com/repos/ncdc/kubernetes/statuses/b79bc657c89cce046460b402b5faf128b0377ef9","head":{"label":"ashcrow:use_netexec_for_spdy_e2e","ref":"use_netexec_for_spdy_e2e","sha":"b79bc657c89cce046460b402b5faf128b0377ef9","user":{"login":"ashcrow","id":22706,"avatar_url":"https://avatars.githubusercontent.com/u/22706?v=3","gravatar_id":"","url":"https://api.github.com/users/ashcrow","html_url":"https://github.com/ashcrow","followers_url":"https://api.github.com/users/ashcrow/followers","following_url":"https://api.github.com/users/ashcrow/following{/other_user}","gists_url":"https://api.github.com/users/ashcrow/gists{/gist_id}","starred_url":"https://api.github.com/users/ashcrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashcrow/subscriptions","organizations_url":"https://api.github.com/users/ashcrow/orgs","repos_url":"https://api.github.com/users/ashcrow/repos","events_url":"https://api.github.com/users/ashcrow/events{/privacy}","received_events_url":"https://api.github.com/users/ashcrow/received_events","type":"User","site_admin":false},"repo":{"id":33780102,"name":"kubernetes","full_name":"ashcrow/kubernetes","owner":{"login":"ashcrow","id":22706,"avatar_url":"https://avatars.githubusercontent.com/u/22706?v=3","gravatar_id":"","url":"https://api.github.com/users/ashcrow","html_url":"https://github.com/ashcrow","followers_url":"https://api.github.com/users/ashcrow/followers","following_url":"https://api.github.com/users/ashcrow/following{/other_user}","gists_url":"https://api.github.com/users/ashcrow/gists{/gist_id}","starred_url":"https://api.github.com/users/ashcrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashcrow/subscriptions","organizations_url":"https://api.github.com/users/ashcrow/orgs","repos_url":"https://api.github.com/users/ashcrow/repos","events_url":"https://api.github.com/users/ashcrow/events{/privacy}","received_events_url":"https://api.github.com/users/ashcrow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashcrow/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/ashcrow/kubernetes","forks_url":"https://api.github.com/repos/ashcrow/kubernetes/forks","keys_url":"https://api.github.com/repos/ashcrow/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashcrow/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashcrow/kubernetes/teams","hooks_url":"https://api.github.com/repos/ashcrow/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/ashcrow/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/ashcrow/kubernetes/events","assignees_url":"https://api.github.com/repos/ashcrow/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/ashcrow/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/ashcrow/kubernetes/tags","blobs_url":"https://api.github.com/repos/ashcrow/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashcrow/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashcrow/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashcrow/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashcrow/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/ashcrow/kubernetes/languages","stargazers_url":"https://api.github.com/repos/ashcrow/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/ashcrow/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/ashcrow/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/ashcrow/kubernetes/subscription","commits_url":"https://api.github.com/repos/ashcrow/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashcrow/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashcrow/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashcrow/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashcrow/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/ashcrow/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashcrow/kubernetes/merges","archive_url":"https://api.github.com/repos/ashcrow/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashcrow/kubernetes/downloads","issues_url":"https://api.github.com/repos/ashcrow/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/ashcrow/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/ashcrow/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/ashcrow/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashcrow/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/ashcrow/kubernetes/releases{/id}","created_at":"2015-04-11T15:06:08Z","updated_at":"2015-05-06T13:05:53Z","pushed_at":"2015-09-17T20:40:46Z","git_url":"git://github.com/ashcrow/kubernetes.git","ssh_url":"git@github.com:ashcrow/kubernetes.git","clone_url":"https://github.com/ashcrow/kubernetes.git","svn_url":"https://github.com/ashcrow/kubernetes","homepage":"http://kubernetes.io","size":106777,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ncdc:add-spdy-proxy-support","ref":"add-spdy-proxy-support","sha":"13d821853e15e6c36f721882a4afc5e1da6ae88a","user":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"repo":{"id":22116483,"name":"kubernetes","full_name":"ncdc/kubernetes","owner":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ncdc/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/ncdc/kubernetes","forks_url":"https://api.github.com/repos/ncdc/kubernetes/forks","keys_url":"https://api.github.com/repos/ncdc/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncdc/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncdc/kubernetes/teams","hooks_url":"https://api.github.com/repos/ncdc/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/ncdc/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/ncdc/kubernetes/events","assignees_url":"https://api.github.com/repos/ncdc/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/ncdc/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/ncdc/kubernetes/tags","blobs_url":"https://api.github.com/repos/ncdc/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncdc/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncdc/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncdc/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncdc/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/ncdc/kubernetes/languages","stargazers_url":"https://api.github.com/repos/ncdc/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/ncdc/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/ncdc/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/ncdc/kubernetes/subscription","commits_url":"https://api.github.com/repos/ncdc/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncdc/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncdc/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncdc/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncdc/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/ncdc/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncdc/kubernetes/merges","archive_url":"https://api.github.com/repos/ncdc/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncdc/kubernetes/downloads","issues_url":"https://api.github.com/repos/ncdc/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/ncdc/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/ncdc/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/ncdc/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncdc/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/ncdc/kubernetes/releases{/id}","created_at":"2014-07-22T18:49:30Z","updated_at":"2015-04-13T16:38:08Z","pushed_at":"2015-09-17T20:28:07Z","git_url":"git://github.com/ncdc/kubernetes.git","ssh_url":"git@github.com:ncdc/kubernetes.git","clone_url":"https://github.com/ncdc/kubernetes.git","svn_url":"https://github.com/ncdc/kubernetes","homepage":null,"size":105823,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/4"},"html":{"href":"https://github.com/ncdc/kubernetes/pull/4"},"issue":{"href":"https://api.github.com/repos/ncdc/kubernetes/issues/4"},"comments":{"href":"https://api.github.com/repos/ncdc/kubernetes/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ncdc/kubernetes/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/ncdc/kubernetes/statuses/b79bc657c89cce046460b402b5faf128b0377ef9"}}}}