{"action":"created","comment":{"url":"https://api.github.com/repos/google/cadvisor/pulls/comments/32115382","id":32115382,"diff_hunk":"@@ -184,6 +182,10 @@ func (self *dockerContainerHandler) GetSpec() (info.ContainerSpec, error) {\n \t}\n \n \tspec := libcontainerConfigToContainerSpec(libcontainerConfig, mi)\n+\n+\tctnr, _ := self.client.InspectContainer(self.id)\n+\tspec.HasNetwork = runconfig.NetworkMode(ctnr.HostConfig.NetworkMode).IsBridge()","path":"container/docker/handler.go","position":24,"original_position":24,"commit_id":"e7d8874b08630b802464fb0185bef1e976880a8b","original_commit_id":"e7d8874b08630b802464fb0185bef1e976880a8b","user":{"login":"vmarmol","id":985208,"avatar_url":"https://avatars.githubusercontent.com/u/985208?v=3","gravatar_id":"","url":"https://api.github.com/users/vmarmol","html_url":"https://github.com/vmarmol","followers_url":"https://api.github.com/users/vmarmol/followers","following_url":"https://api.github.com/users/vmarmol/following{/other_user}","gists_url":"https://api.github.com/users/vmarmol/gists{/gist_id}","starred_url":"https://api.github.com/users/vmarmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmarmol/subscriptions","organizations_url":"https://api.github.com/users/vmarmol/orgs","repos_url":"https://api.github.com/users/vmarmol/repos","events_url":"https://api.github.com/users/vmarmol/events{/privacy}","received_events_url":"https://api.github.com/users/vmarmol/received_events","type":"User","site_admin":false},"body":"Nice!\r\n\r\nAnother possible option is to check if the libcontainer config has an empty [Network](https://github.com/docker/libcontainer/blob/master/configs/config.go#L99). This would save us the Docker inspect call in every `GetSpec()` which would be nice. If that's possible, let's do that :)","created_at":"2015-06-10T13:15:53Z","updated_at":"2015-06-10T13:15:53Z","html_url":"https://github.com/google/cadvisor/pull/764#discussion_r32115382","pull_request_url":"https://api.github.com/repos/google/cadvisor/pulls/764","_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments/32115382"},"html":{"href":"https://github.com/google/cadvisor/pull/764#discussion_r32115382"},"pull_request":{"href":"https://api.github.com/repos/google/cadvisor/pulls/764"}}},"pull_request":{"url":"https://api.github.com/repos/google/cadvisor/pulls/764","id":37304469,"html_url":"https://github.com/google/cadvisor/pull/764","diff_url":"https://github.com/google/cadvisor/pull/764.diff","patch_url":"https://github.com/google/cadvisor/pull/764.patch","issue_url":"https://api.github.com/repos/google/cadvisor/issues/764","number":764,"state":"open","locked":false,"title":"Only show network statistics for containers with bridge network","user":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"body":"Victor mentioned that there was a 1 line modification that solves the problem, but I couldn't find it. I'm still very new to the cAdvisor code base and to Docker - it took me pretty long to figure out where the specs were stored, and how to extract configuration information from Docker, so I certainly could be doing this in a sub-optimal way. Let me know!","created_at":"2015-06-09T21:55:02Z","updated_at":"2015-06-10T13:15:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76333497219c116595d7d1e9a5c9cb5ea7694dbe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/cadvisor/pulls/764/commits","review_comments_url":"https://api.github.com/repos/google/cadvisor/pulls/764/comments","review_comment_url":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/cadvisor/issues/764/comments","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/e7d8874b08630b802464fb0185bef1e976880a8b","head":{"label":"AnanyaKumar:net-host-bug","ref":"net-host-bug","sha":"e7d8874b08630b802464fb0185bef1e976880a8b","user":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"repo":{"id":37098049,"name":"cadvisor","full_name":"AnanyaKumar/cadvisor","owner":{"login":"AnanyaKumar","id":1862850,"avatar_url":"https://avatars.githubusercontent.com/u/1862850?v=3","gravatar_id":"","url":"https://api.github.com/users/AnanyaKumar","html_url":"https://github.com/AnanyaKumar","followers_url":"https://api.github.com/users/AnanyaKumar/followers","following_url":"https://api.github.com/users/AnanyaKumar/following{/other_user}","gists_url":"https://api.github.com/users/AnanyaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/AnanyaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnanyaKumar/subscriptions","organizations_url":"https://api.github.com/users/AnanyaKumar/orgs","repos_url":"https://api.github.com/users/AnanyaKumar/repos","events_url":"https://api.github.com/users/AnanyaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/AnanyaKumar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnanyaKumar/cadvisor","description":"Analyzes resource usage and performance characteristics of running containers.","fork":true,"url":"https://api.github.com/repos/AnanyaKumar/cadvisor","forks_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/forks","keys_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/teams","hooks_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/hooks","issue_events_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/issues/events{/number}","events_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/events","assignees_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/assignees{/user}","branches_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/branches{/branch}","tags_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/tags","blobs_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/languages","stargazers_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/stargazers","contributors_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/contributors","subscribers_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/subscribers","subscription_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/subscription","commits_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/contents/{+path}","compare_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/merges","archive_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/downloads","issues_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/issues{/number}","pulls_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/labels{/name}","releases_url":"https://api.github.com/repos/AnanyaKumar/cadvisor/releases{/id}","created_at":"2015-06-08T23:11:26Z","updated_at":"2015-06-08T23:11:27Z","pushed_at":"2015-06-10T07:52:18Z","git_url":"git://github.com/AnanyaKumar/cadvisor.git","ssh_url":"git@github.com:AnanyaKumar/cadvisor.git","clone_url":"https://github.com/AnanyaKumar/cadvisor.git","svn_url":"https://github.com/AnanyaKumar/cadvisor","homepage":"","size":27182,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"google:master","ref":"master","sha":"b0753a6d69458256ccaffdc60043d63147cd81af","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":20653934,"name":"cadvisor","full_name":"google/cadvisor","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/cadvisor","description":"Analyzes resource usage and performance characteristics of running containers.","fork":false,"url":"https://api.github.com/repos/google/cadvisor","forks_url":"https://api.github.com/repos/google/cadvisor/forks","keys_url":"https://api.github.com/repos/google/cadvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/cadvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/cadvisor/teams","hooks_url":"https://api.github.com/repos/google/cadvisor/hooks","issue_events_url":"https://api.github.com/repos/google/cadvisor/issues/events{/number}","events_url":"https://api.github.com/repos/google/cadvisor/events","assignees_url":"https://api.github.com/repos/google/cadvisor/assignees{/user}","branches_url":"https://api.github.com/repos/google/cadvisor/branches{/branch}","tags_url":"https://api.github.com/repos/google/cadvisor/tags","blobs_url":"https://api.github.com/repos/google/cadvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/cadvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/cadvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/cadvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/cadvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/google/cadvisor/languages","stargazers_url":"https://api.github.com/repos/google/cadvisor/stargazers","contributors_url":"https://api.github.com/repos/google/cadvisor/contributors","subscribers_url":"https://api.github.com/repos/google/cadvisor/subscribers","subscription_url":"https://api.github.com/repos/google/cadvisor/subscription","commits_url":"https://api.github.com/repos/google/cadvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/cadvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/cadvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/cadvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/cadvisor/contents/{+path}","compare_url":"https://api.github.com/repos/google/cadvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/cadvisor/merges","archive_url":"https://api.github.com/repos/google/cadvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/cadvisor/downloads","issues_url":"https://api.github.com/repos/google/cadvisor/issues{/number}","pulls_url":"https://api.github.com/repos/google/cadvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/google/cadvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/google/cadvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/cadvisor/labels{/name}","releases_url":"https://api.github.com/repos/google/cadvisor/releases{/id}","created_at":"2014-06-09T16:36:33Z","updated_at":"2015-06-10T12:19:37Z","pushed_at":"2015-06-10T07:52:18Z","git_url":"git://github.com/google/cadvisor.git","ssh_url":"git@github.com:google/cadvisor.git","clone_url":"https://github.com/google/cadvisor.git","svn_url":"https://github.com/google/cadvisor","homepage":"","size":27182,"stargazers_count":2458,"watchers_count":2458,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":263,"mirror_url":null,"open_issues_count":50,"forks":263,"open_issues":50,"watchers":2458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/cadvisor/pulls/764"},"html":{"href":"https://github.com/google/cadvisor/pull/764"},"issue":{"href":"https://api.github.com/repos/google/cadvisor/issues/764"},"comments":{"href":"https://api.github.com/repos/google/cadvisor/issues/764/comments"},"review_comments":{"href":"https://api.github.com/repos/google/cadvisor/pulls/764/comments"},"review_comment":{"href":"https://api.github.com/repos/google/cadvisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/cadvisor/pulls/764/commits"},"statuses":{"href":"https://api.github.com/repos/google/cadvisor/statuses/e7d8874b08630b802464fb0185bef1e976880a8b"}}}}