{"action":"created","comment":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/comments/40078930","id":40078930,"diff_hunk":"@@ -2,16 +2,41 @@ package proxy\n \n import (\n \t\"net/http\"\n+\n+\t\"github.com/fsouza/go-dockerclient\"\n )\n \n type startContainerInterceptor struct{ proxy *Proxy }\n \n+type startContainerRequestBody struct {\n+\tHostConfig *docker.HostConfig `json:\"HostConfig,omitempty\" yaml:\"HostConfig,omitempty\"`\n+}\n+\n func (i *startContainerInterceptor) InterceptRequest(r *http.Request) error {\n \tcontainer, err := inspectContainerInPath(i.proxy.client, r.URL.Path)\n-\tif err == nil && containerShouldAttach(container) {\n+\tif err != nil || !containerShouldAttach(container) {\n+\t\treturn err\n+\t}\n+\n+\tif r.Header.Get(\"Content-Type\") != \"application/json\" {\n \t\ti.proxy.createWait(r, container.ID)\n+\t\treturn nil\n \t}\n-\treturn err\n+\n+\thostConfig := &docker.HostConfig{}\n+\tif err := unmarshalRequestBody(r, &hostConfig); err != nil {\n+\t\treturn err\n+\t}\n+\n+\ti.proxy.addWeaveWaitVolume(hostConfig)\n+\tif dnsDomain, withDNS := i.proxy.getDNSDomain(); withDNS {\n+\t\tif err := i.proxy.setWeaveDNS(hostConfig, container.Config.Hostname, dnsDomain); err != nil {","path":"proxy/start_container_interceptor.go","position":34,"original_position":34,"commit_id":"067f88d51e8602f03d01e5235206c221aca15d19","original_commit_id":"067f88d51e8602f03d01e5235206c221aca15d19","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":"I don't think so. `dnsDomain` is the (possibly) untrimmed version `weave.local.`, while the `container.Config.Domainname` gets the trailing dot trimmed off. We only set it if the user has not specified `--name`, `--hostname`, or `--dns-search`.","created_at":"2015-09-22T12:19:26Z","updated_at":"2015-09-22T12:19:26Z","html_url":"https://github.com/weaveworks/weave/pull/1449#discussion_r40078930","pull_request_url":"https://api.github.com/repos/weaveworks/weave/pulls/1449","_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments/40078930"},"html":{"href":"https://github.com/weaveworks/weave/pull/1449#discussion_r40078930"},"pull_request":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/1449"}}},"pull_request":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/1449","id":45425149,"html_url":"https://github.com/weaveworks/weave/pull/1449","diff_url":"https://github.com/weaveworks/weave/pull/1449.diff","patch_url":"https://github.com/weaveworks/weave/pull/1449.patch","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/1449","number":1449,"state":"open","locked":false,"title":"Override sneaky /start HostConfig params","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":"Fixes #1368","created_at":"2015-09-18T16:21:48Z","updated_at":"2015-09-22T12:19:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e3a17d4f251c2dffa2be5e37c0394258897c062","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/weaveworks/weave/pulls/1449/commits","review_comments_url":"https://api.github.com/repos/weaveworks/weave/pulls/1449/comments","review_comment_url":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/1449/comments","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/067f88d51e8602f03d01e5235206c221aca15d19","head":{"label":"weaveworks:1368-start-hostconfig","ref":"1368-start-hostconfig","sha":"067f88d51e8602f03d01e5235206c221aca15d19","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":"Weaving Docker containers into applications","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-09-22T12:18:53Z","pushed_at":"2015-09-22T11:58:58Z","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":17209,"stargazers_count":3710,"watchers_count":3710,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":228,"mirror_url":null,"open_issues_count":160,"forks":228,"open_issues":160,"watchers":3710,"default_branch":"master"}},"base":{"label":"weaveworks:master","ref":"master","sha":"934428926228de483356a9241f4d62262497d89e","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":"Weaving Docker containers into applications","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-09-22T12:18:53Z","pushed_at":"2015-09-22T11:58:58Z","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":17209,"stargazers_count":3710,"watchers_count":3710,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":228,"mirror_url":null,"open_issues_count":160,"forks":228,"open_issues":160,"watchers":3710,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/1449"},"html":{"href":"https://github.com/weaveworks/weave/pull/1449"},"issue":{"href":"https://api.github.com/repos/weaveworks/weave/issues/1449"},"comments":{"href":"https://api.github.com/repos/weaveworks/weave/issues/1449/comments"},"review_comments":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/1449/comments"},"review_comment":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/1449/commits"},"statuses":{"href":"https://api.github.com/repos/weaveworks/weave/statuses/067f88d51e8602f03d01e5235206c221aca15d19"}}}}