{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/68688705","id":68688705,"diff_hunk":"@@ -203,6 +217,25 @@ func (dsw *desiredStateOfWorld) AddPodToVolume(\n \treturn volumeName, nil\n }\n \n+func (dsw *desiredStateOfWorld) MarkVolumesReportedInUse(\n+\treportedVolumes []api.UniqueVolumeName) {\n+\tdsw.Lock()\n+\tdefer dsw.Unlock()\n+\n+\treportedVolumesMap := make(\n+\t\tmap[api.UniqueVolumeName]bool, len(reportedVolumes) /* capacity */)\n+\n+\tfor _, reportedVolume := range reportedVolumes {\n+\t\treportedVolumesMap[reportedVolume] = true\n+\t}\n+\n+\tfor volumeName, volumeObj := range dsw.volumesToMount {\n+\t\t_, volumeReported := reportedVolumesMap[volumeName]\n+\t\tvolumeObj.reportedInUse = volumeReported\n+\t\tdsw.volumesToMount[volumeName] = volumeObj","path":"pkg/kubelet/volume/cache/desired_state_of_world.go","position":55,"original_position":54,"commit_id":"57f6b78f80bcea730f9bd4313fe1beb53d40a975","original_commit_id":"6dc421290a1833bce6b930f975674aae1a034312","user":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"body":"For future work - this is why you should never have a map where the value type is a struct.  If forces you to copy the struct out and write it back just to update a field.  If the map value were a pointer, no problem.","created_at":"2016-06-28T02:22:41Z","updated_at":"2016-06-28T02:22:41Z","html_url":"https://github.com/kubernetes/kubernetes/pull/28095#discussion_r68688705","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/68688705"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/28095#discussion_r68688705"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095","id":75249438,"html_url":"https://github.com/kubernetes/kubernetes/pull/28095","diff_url":"https://github.com/kubernetes/kubernetes/pull/28095.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/28095.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28095","number":28095,"state":"open","locked":false,"title":"Kubelet should mark VolumeInUse before checking if it is Attached","user":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"body":"Kubelet should mark VolumeInUse before checking if it is Attached.\r\nController should fetch fresh copy of node object before detach instead of relying on node informer cache.\r\n\r\nFixes #27836\r\n","created_at":"2016-06-27T02:15:27Z","updated_at":"2016-06-28T02:22:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6db26919008470b879047d9129ce485f18f982b","assignee":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"assignees":[{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/18","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.3","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/18/labels","id":1638460,"number":18,"title":"v1.3","description":"https://github.com/kubernetes/kubernetes/wiki/Release-1.3","creator":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":1023,"state":"open","created_at":"2016-03-11T07:40:20Z","updated_at":"2016-06-28T00:38:42Z","due_on":"2016-06-24T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28095/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/57f6b78f80bcea730f9bd4313fe1beb53d40a975","head":{"label":"saad-ali:fixRacyVolumesInUse","ref":"fixRacyVolumesInUse","sha":"57f6b78f80bcea730f9bd4313fe1beb53d40a975","user":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"repo":{"id":27614790,"name":"kubernetes","full_name":"saad-ali/kubernetes","owner":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/saad-ali/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/saad-ali/kubernetes","forks_url":"https://api.github.com/repos/saad-ali/kubernetes/forks","keys_url":"https://api.github.com/repos/saad-ali/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saad-ali/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saad-ali/kubernetes/teams","hooks_url":"https://api.github.com/repos/saad-ali/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/saad-ali/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/saad-ali/kubernetes/events","assignees_url":"https://api.github.com/repos/saad-ali/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/saad-ali/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/saad-ali/kubernetes/tags","blobs_url":"https://api.github.com/repos/saad-ali/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saad-ali/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saad-ali/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/saad-ali/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saad-ali/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/saad-ali/kubernetes/languages","stargazers_url":"https://api.github.com/repos/saad-ali/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/saad-ali/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/saad-ali/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/saad-ali/kubernetes/subscription","commits_url":"https://api.github.com/repos/saad-ali/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/saad-ali/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/saad-ali/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/saad-ali/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/saad-ali/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/saad-ali/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saad-ali/kubernetes/merges","archive_url":"https://api.github.com/repos/saad-ali/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saad-ali/kubernetes/downloads","issues_url":"https://api.github.com/repos/saad-ali/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/saad-ali/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/saad-ali/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/saad-ali/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saad-ali/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/saad-ali/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/saad-ali/kubernetes/deployments","created_at":"2014-12-05T23:31:31Z","updated_at":"2016-01-22T23:53:04Z","pushed_at":"2016-06-28T00:33:31Z","git_url":"git://github.com/saad-ali/kubernetes.git","ssh_url":"git@github.com:saad-ali/kubernetes.git","clone_url":"https://github.com/saad-ali/kubernetes.git","svn_url":"https://github.com/saad-ali/kubernetes","homepage":null,"size":265980,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"700fbd0543e38c610c124ae55e49039b2b34cca9","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":"Production-Grade Container Scheduling and Management","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}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-06-28T01:37:00Z","pushed_at":"2016-06-28T02:10:18Z","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":483442,"stargazers_count":15118,"watchers_count":15118,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4724,"mirror_url":null,"open_issues_count":3781,"forks":4724,"open_issues":3781,"watchers":15118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/28095"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/28095"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/28095/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28095/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/57f6b78f80bcea730f9bd4313fe1beb53d40a975"}}}}
{"actor":{"display_login":"thockin"}}