{"action":"created","comment":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/comments/30614505","id":30614505,"diff_hunk":"@@ -0,0 +1,65 @@\n+package proxy\n+\n+import (\n+\t\"bytes\"\n+\t\"encoding/json\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\n+\t\"github.com/fsouza/go-dockerclient\"\n+\t. \"github.com/weaveworks/weave/common\"\n+)\n+\n+type createExecInterceptor struct {\n+\tclient *docker.Client\n+}\n+\n+type createExecRequestBody struct {\n+\t*docker.Config\n+\tHostConfig *docker.HostConfig `json:\"HostConfig,omitempty\" yaml:\"HostConfig,omitempty\"`\n+\tMacAddress string             `json:\"MacAddress,omitempty\" yaml:\"MacAddress,omitempty\"`\n+}\n+\n+func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {\n+\tbody, err := ioutil.ReadAll(r.Body)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tr.Body.Close()\n+\tInfo.Println(\"CreateExecInterceptor Intercepting: \", string(body))\n+\n+\toptions := docker.CreateExecOptions{}\n+\tif err := json.Unmarshal(body, &options); err != nil {\n+\t\treturn err\n+\t}\n+\n+\tsubs := containerIDRegexp.FindStringSubmatch(r.URL.Path)","path":"proxy/create_exec_interceptor.go","position":36,"original_position":36,"commit_id":"0d99ff8b7782dab3ff7683de860d6e22548b08fb","original_commit_id":"0d99ff8b7782dab3ff7683de860d6e22548b08fb","user":{"login":"rade","id":109109,"avatar_url":"https://avatars.githubusercontent.com/u/109109?v=3","gravatar_id":"","url":"https://api.github.com/users/rade","html_url":"https://github.com/rade","followers_url":"https://api.github.com/users/rade/followers","following_url":"https://api.github.com/users/rade/following{/other_user}","gists_url":"https://api.github.com/users/rade/gists{/gist_id}","starred_url":"https://api.github.com/users/rade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rade/subscriptions","organizations_url":"https://api.github.com/users/rade/orgs","repos_url":"https://api.github.com/users/rade/repos","events_url":"https://api.github.com/users/rade/events{/privacy}","received_events_url":"https://api.github.com/users/rade/received_events","type":"User","site_admin":false},"body":"though actually perhaps we should have helper function that extracts the container id from a path. so we don't end up duplicating the following lines. Perhaps even include the `InspectContainer`.","created_at":"2015-05-19T15:55:29Z","updated_at":"2015-05-19T15:55:29Z","html_url":"https://github.com/weaveworks/weave/pull/702#discussion_r30614505","pull_request_url":"https://api.github.com/repos/weaveworks/weave/pulls/702","_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments/30614505"},"html":{"href":"https://github.com/weaveworks/weave/pull/702#discussion_r30614505"},"pull_request":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/702"}}},"pull_request":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/702","id":35742625,"html_url":"https://github.com/weaveworks/weave/pull/702","diff_url":"https://github.com/weaveworks/weave/pull/702.diff","patch_url":"https://github.com/weaveworks/weave/pull/702.patch","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/702","number":702,"state":"closed","locked":false,"title":"proxy needs to add weavewait to execs as well","user":{"login":"paulbellamy","id":250199,"avatar_url":"https://avatars.githubusercontent.com/u/250199?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbellamy","html_url":"https://github.com/paulbellamy","followers_url":"https://api.github.com/users/paulbellamy/followers","following_url":"https://api.github.com/users/paulbellamy/following{/other_user}","gists_url":"https://api.github.com/users/paulbellamy/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbellamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbellamy/subscriptions","organizations_url":"https://api.github.com/users/paulbellamy/orgs","repos_url":"https://api.github.com/users/paulbellamy/repos","events_url":"https://api.github.com/users/paulbellamy/events{/privacy}","received_events_url":"https://api.github.com/users/paulbellamy/received_events","type":"User","site_admin":false},"body":"Bug came up in a test where we are restarting and doing an exec checking\r\na network interface right away. weavewait is only added if the container\r\nhas a WEAVE_CIDR var set, the same as at container creation.","created_at":"2015-05-19T15:28:09Z","updated_at":"2015-05-19T15:55:29Z","closed_at":"2015-05-19T15:31:15Z","merged_at":null,"merge_commit_sha":"fcbb2060274110101f7d5132f447a4f8a0e0f3f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/weaveworks/weave/pulls/702/commits","review_comments_url":"https://api.github.com/repos/weaveworks/weave/pulls/702/comments","review_comment_url":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/702/comments","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/0d99ff8b7782dab3ff7683de860d6e22548b08fb","head":{"label":"paulbellamy:proxy-minimal","ref":"proxy-minimal","sha":"0d99ff8b7782dab3ff7683de860d6e22548b08fb","user":{"login":"paulbellamy","id":250199,"avatar_url":"https://avatars.githubusercontent.com/u/250199?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbellamy","html_url":"https://github.com/paulbellamy","followers_url":"https://api.github.com/users/paulbellamy/followers","following_url":"https://api.github.com/users/paulbellamy/following{/other_user}","gists_url":"https://api.github.com/users/paulbellamy/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbellamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbellamy/subscriptions","organizations_url":"https://api.github.com/users/paulbellamy/orgs","repos_url":"https://api.github.com/users/paulbellamy/repos","events_url":"https://api.github.com/users/paulbellamy/events{/privacy}","received_events_url":"https://api.github.com/users/paulbellamy/received_events","type":"User","site_admin":false},"repo":{"id":35087430,"name":"weave","full_name":"paulbellamy/weave","owner":{"login":"paulbellamy","id":250199,"avatar_url":"https://avatars.githubusercontent.com/u/250199?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbellamy","html_url":"https://github.com/paulbellamy","followers_url":"https://api.github.com/users/paulbellamy/followers","following_url":"https://api.github.com/users/paulbellamy/following{/other_user}","gists_url":"https://api.github.com/users/paulbellamy/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbellamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbellamy/subscriptions","organizations_url":"https://api.github.com/users/paulbellamy/orgs","repos_url":"https://api.github.com/users/paulbellamy/repos","events_url":"https://api.github.com/users/paulbellamy/events{/privacy}","received_events_url":"https://api.github.com/users/paulbellamy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulbellamy/weave","description":"The Docker Network","fork":true,"url":"https://api.github.com/repos/paulbellamy/weave","forks_url":"https://api.github.com/repos/paulbellamy/weave/forks","keys_url":"https://api.github.com/repos/paulbellamy/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulbellamy/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulbellamy/weave/teams","hooks_url":"https://api.github.com/repos/paulbellamy/weave/hooks","issue_events_url":"https://api.github.com/repos/paulbellamy/weave/issues/events{/number}","events_url":"https://api.github.com/repos/paulbellamy/weave/events","assignees_url":"https://api.github.com/repos/paulbellamy/weave/assignees{/user}","branches_url":"https://api.github.com/repos/paulbellamy/weave/branches{/branch}","tags_url":"https://api.github.com/repos/paulbellamy/weave/tags","blobs_url":"https://api.github.com/repos/paulbellamy/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulbellamy/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulbellamy/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulbellamy/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulbellamy/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/paulbellamy/weave/languages","stargazers_url":"https://api.github.com/repos/paulbellamy/weave/stargazers","contributors_url":"https://api.github.com/repos/paulbellamy/weave/contributors","subscribers_url":"https://api.github.com/repos/paulbellamy/weave/subscribers","subscription_url":"https://api.github.com/repos/paulbellamy/weave/subscription","commits_url":"https://api.github.com/repos/paulbellamy/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulbellamy/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulbellamy/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulbellamy/weave/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulbellamy/weave/contents/{+path}","compare_url":"https://api.github.com/repos/paulbellamy/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulbellamy/weave/merges","archive_url":"https://api.github.com/repos/paulbellamy/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulbellamy/weave/downloads","issues_url":"https://api.github.com/repos/paulbellamy/weave/issues{/number}","pulls_url":"https://api.github.com/repos/paulbellamy/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/paulbellamy/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/paulbellamy/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulbellamy/weave/labels{/name}","releases_url":"https://api.github.com/repos/paulbellamy/weave/releases{/id}","created_at":"2015-05-05T08:29:04Z","updated_at":"2015-05-08T10:26:31Z","pushed_at":"2015-05-19T15:50:39Z","git_url":"git://github.com/paulbellamy/weave.git","ssh_url":"git@github.com:paulbellamy/weave.git","clone_url":"https://github.com/paulbellamy/weave.git","svn_url":"https://github.com/paulbellamy/weave","homepage":"http://weave.works","size":2585,"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":"weaveworks:master","ref":"master","sha":"70b595c4a20d28f3516fee9c77767c25ad3c1fbb","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":23059575,"name":"weave","full_name":"weaveworks/weave","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/weave","description":"The Docker Network","fork":false,"url":"https://api.github.com/repos/weaveworks/weave","forks_url":"https://api.github.com/repos/weaveworks/weave/forks","keys_url":"https://api.github.com/repos/weaveworks/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/weave/teams","hooks_url":"https://api.github.com/repos/weaveworks/weave/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/weave/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/weave/events","assignees_url":"https://api.github.com/repos/weaveworks/weave/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/weave/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/weave/tags","blobs_url":"https://api.github.com/repos/weaveworks/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/weave/languages","stargazers_url":"https://api.github.com/repos/weaveworks/weave/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/weave/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/weave/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/weave/subscription","commits_url":"https://api.github.com/repos/weaveworks/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/weave/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/weave/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/weave/merges","archive_url":"https://api.github.com/repos/weaveworks/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/weave/downloads","issues_url":"https://api.github.com/repos/weaveworks/weave/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/weave/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/weave/releases{/id}","created_at":"2014-08-18T05:19:07Z","updated_at":"2015-05-19T09:21:29Z","pushed_at":"2015-05-19T15:28:09Z","git_url":"git://github.com/weaveworks/weave.git","ssh_url":"git@github.com:weaveworks/weave.git","clone_url":"https://github.com/weaveworks/weave.git","svn_url":"https://github.com/weaveworks/weave","homepage":"http://weave.works","size":11912,"stargazers_count":3308,"watchers_count":3308,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":178,"mirror_url":null,"open_issues_count":114,"forks":178,"open_issues":114,"watchers":3308,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/702"},"html":{"href":"https://github.com/weaveworks/weave/pull/702"},"issue":{"href":"https://api.github.com/repos/weaveworks/weave/issues/702"},"comments":{"href":"https://api.github.com/repos/weaveworks/weave/issues/702/comments"},"review_comments":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/702/comments"},"review_comment":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/702/commits"},"statuses":{"href":"https://api.github.com/repos/weaveworks/weave/statuses/0d99ff8b7782dab3ff7683de860d6e22548b08fb"}}}}