{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42775376","id":42775376,"diff_hunk":"@@ -955,8 +958,12 @@ func (kl *Kubelet) syncNodeStatus() {\n \t}\n }\n \n-func makeMounts(container *api.Container, podVolumes kubecontainer.VolumeMap) (mounts []kubecontainer.Mount) {\n+func (kl *Kubelet) makeMounts(pod *api.Pod, container *api.Container, podVolumes kubecontainer.VolumeMap) ([]kubecontainer.Mount, error) {\n+\tmountEtcHostsFile := !pod.Spec.SecurityContext.HostNetwork && len(pod.Status.PodIP) > 0","path":"pkg/kubelet/kubelet.go","position":23,"original_position":23,"commit_id":"5b2f28d35ee913ad4541ee023b027c8f6c7d62c4","original_commit_id":"5b2f28d35ee913ad4541ee023b027c8f6c7d62c4","user":{"login":"dchen1107","id":7740897,"avatar_url":"https://avatars.githubusercontent.com/u/7740897?v=3","gravatar_id":"","url":"https://api.github.com/users/dchen1107","html_url":"https://github.com/dchen1107","followers_url":"https://api.github.com/users/dchen1107/followers","following_url":"https://api.github.com/users/dchen1107/following{/other_user}","gists_url":"https://api.github.com/users/dchen1107/gists{/gist_id}","starred_url":"https://api.github.com/users/dchen1107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchen1107/subscriptions","organizations_url":"https://api.github.com/users/dchen1107/orgs","repos_url":"https://api.github.com/users/dchen1107/repos","events_url":"https://api.github.com/users/dchen1107/events{/privacy}","received_events_url":"https://api.github.com/users/dchen1107/received_events","type":"User","site_admin":false},"body":"Please comment here: You only create etc_hosts file for containers meeting both requirements:\r\n1) not using host network. This is pretty straight-forward. But worth a comment to make sure other maintainer won't break this logic in the future.\r\n2) podIP is available already. This means network infrastructure container's etc_hosts file is different from rest of containers. It should be ok since that is a hidden container, and not used by the users anyway. But it is confusing. I did stair at it for a couple of minutes to figure it out. :-) \r\n","created_at":"2015-10-22T17:01:59Z","updated_at":"2015-10-22T17:01:59Z","html_url":"https://github.com/kubernetes/kubernetes/pull/16052#discussion_r42775376","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/42775376"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/16052#discussion_r42775376"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052","id":48381086,"html_url":"https://github.com/kubernetes/kubernetes/pull/16052","diff_url":"https://github.com/kubernetes/kubernetes/pull/16052.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/16052.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16052","number":16052,"state":"open","locked":false,"title":"kubelet manages /etc/hosts file","user":{"login":"ArtfulCoder","id":1220660,"avatar_url":"https://avatars.githubusercontent.com/u/1220660?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtfulCoder","html_url":"https://github.com/ArtfulCoder","followers_url":"https://api.github.com/users/ArtfulCoder/followers","following_url":"https://api.github.com/users/ArtfulCoder/following{/other_user}","gists_url":"https://api.github.com/users/ArtfulCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtfulCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtfulCoder/subscriptions","organizations_url":"https://api.github.com/users/ArtfulCoder/orgs","repos_url":"https://api.github.com/users/ArtfulCoder/repos","events_url":"https://api.github.com/users/ArtfulCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ArtfulCoder/received_events","type":"User","site_admin":false},"body":"This implementation relies on https://github.com/docker/docker/pull/14613\r\n","created_at":"2015-10-21T20:10:00Z","updated_at":"2015-10-22T17:01:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4b2ec52c2125d6c97dab07d0b57e4d4f22075c1","assignee":{"login":"dchen1107","id":7740897,"avatar_url":"https://avatars.githubusercontent.com/u/7740897?v=3","gravatar_id":"","url":"https://api.github.com/users/dchen1107","html_url":"https://github.com/dchen1107","followers_url":"https://api.github.com/users/dchen1107/followers","following_url":"https://api.github.com/users/dchen1107/following{/other_user}","gists_url":"https://api.github.com/users/dchen1107/gists{/gist_id}","starred_url":"https://api.github.com/users/dchen1107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchen1107/subscriptions","organizations_url":"https://api.github.com/users/dchen1107/orgs","repos_url":"https://api.github.com/users/dchen1107/repos","events_url":"https://api.github.com/users/dchen1107/events{/privacy}","received_events_url":"https://api.github.com/users/dchen1107/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16052/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/5b2f28d35ee913ad4541ee023b027c8f6c7d62c4","head":{"label":"ArtfulCoder:mount_etc_hosts","ref":"mount_etc_hosts","sha":"5b2f28d35ee913ad4541ee023b027c8f6c7d62c4","user":{"login":"ArtfulCoder","id":1220660,"avatar_url":"https://avatars.githubusercontent.com/u/1220660?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtfulCoder","html_url":"https://github.com/ArtfulCoder","followers_url":"https://api.github.com/users/ArtfulCoder/followers","following_url":"https://api.github.com/users/ArtfulCoder/following{/other_user}","gists_url":"https://api.github.com/users/ArtfulCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtfulCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtfulCoder/subscriptions","organizations_url":"https://api.github.com/users/ArtfulCoder/orgs","repos_url":"https://api.github.com/users/ArtfulCoder/repos","events_url":"https://api.github.com/users/ArtfulCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ArtfulCoder/received_events","type":"User","site_admin":false},"repo":{"id":29879916,"name":"kubernetes","full_name":"ArtfulCoder/kubernetes","owner":{"login":"ArtfulCoder","id":1220660,"avatar_url":"https://avatars.githubusercontent.com/u/1220660?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtfulCoder","html_url":"https://github.com/ArtfulCoder","followers_url":"https://api.github.com/users/ArtfulCoder/followers","following_url":"https://api.github.com/users/ArtfulCoder/following{/other_user}","gists_url":"https://api.github.com/users/ArtfulCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtfulCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtfulCoder/subscriptions","organizations_url":"https://api.github.com/users/ArtfulCoder/orgs","repos_url":"https://api.github.com/users/ArtfulCoder/repos","events_url":"https://api.github.com/users/ArtfulCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ArtfulCoder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ArtfulCoder/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/ArtfulCoder/kubernetes","forks_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/forks","keys_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/teams","hooks_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/events","assignees_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/tags","blobs_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/languages","stargazers_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/subscription","commits_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/merges","archive_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/downloads","issues_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/ArtfulCoder/kubernetes/releases{/id}","created_at":"2015-01-26T20:25:09Z","updated_at":"2015-05-07T20:25:01Z","pushed_at":"2015-10-22T00:25:52Z","git_url":"git://github.com/ArtfulCoder/kubernetes.git","ssh_url":"git@github.com:ArtfulCoder/kubernetes.git","clone_url":"https://github.com/ArtfulCoder/kubernetes.git","svn_url":"https://github.com/ArtfulCoder/kubernetes","homepage":"http://kubernetes.io","size":118915,"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":"kubernetes:master","ref":"master","sha":"a702d5f29bd3236d4ee4702771b8928f8e6d460e","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-10-22T16:52:44Z","pushed_at":"2015-10-22T16:59:21Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":495415,"stargazers_count":10819,"watchers_count":10819,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2753,"mirror_url":null,"open_issues_count":2093,"forks":2753,"open_issues":2093,"watchers":10819,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/16052"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/16052"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/16052/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16052/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/5b2f28d35ee913ad4541ee023b027c8f6c7d62c4"}}}}