{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/46197063","id":46197063,"diff_hunk":"@@ -112,6 +113,11 @@ type NodeController struct {\n \tnodeStore      cache.StoreToNodeLister\n \n \tforcefullyDeletePod func(*api.Pod)\n+\tavailableCIDRs      sets.Int\n+\t// Record the first CIDR which has not been put into the availableCIDR set\n+\tfirstAvailable int","path":"pkg/controller/node/nodecontroller.go","position":14,"original_position":14,"commit_id":"8d46210cb03a3fe5b66234b678bc28dbe108c539","original_commit_id":"8d46210cb03a3fe5b66234b678bc28dbe108c539","user":{"login":"WeixuZhuang","id":15804885,"avatar_url":"https://avatars.githubusercontent.com/u/15804885?v=3","gravatar_id":"","url":"https://api.github.com/users/WeixuZhuang","html_url":"https://github.com/WeixuZhuang","followers_url":"https://api.github.com/users/WeixuZhuang/followers","following_url":"https://api.github.com/users/WeixuZhuang/following{/other_user}","gists_url":"https://api.github.com/users/WeixuZhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/WeixuZhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeixuZhuang/subscriptions","organizations_url":"https://api.github.com/users/WeixuZhuang/orgs","repos_url":"https://api.github.com/users/WeixuZhuang/repos","events_url":"https://api.github.com/users/WeixuZhuang/events{/privacy}","received_events_url":"https://api.github.com/users/WeixuZhuang/received_events","type":"User","site_admin":false},"body":"This var defines the first CIDR which has not been put into the availableCIDRs set. For example, we have totally 300 nodes. They need totally 300 CIDRs. Since the node controller will generate 256 new available CIDRs each time generateNewAvailabeCIDRs() being called, the function generateNewAvailabeCIDRs() will be called twice. Now the firstAvailable will be 512 which means next time when we want to generate new CIDRs and insert it into availableCIDRs set(call function generateNewAvailabeCIDRs()). Next time we we call generateNewAvailabeCIDRs(), it should begin from No. 512th CIDR which mean the firstAvailable=512.","created_at":"2015-11-30T20:17:08Z","updated_at":"2015-11-30T20:17:08Z","html_url":"https://github.com/kubernetes/kubernetes/pull/17754#discussion_r46197063","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/46197063"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/17754#discussion_r46197063"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754","id":51745005,"html_url":"https://github.com/kubernetes/kubernetes/pull/17754","diff_url":"https://github.com/kubernetes/kubernetes/pull/17754.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/17754.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17754","number":17754,"state":"open","locked":false,"title":"Fix TODO in pkg/controller/nodecontroller.go line 472","user":{"login":"WeixuZhuang","id":15804885,"avatar_url":"https://avatars.githubusercontent.com/u/15804885?v=3","gravatar_id":"","url":"https://api.github.com/users/WeixuZhuang","html_url":"https://github.com/WeixuZhuang","followers_url":"https://api.github.com/users/WeixuZhuang/followers","following_url":"https://api.github.com/users/WeixuZhuang/following{/other_user}","gists_url":"https://api.github.com/users/WeixuZhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/WeixuZhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeixuZhuang/subscriptions","organizations_url":"https://api.github.com/users/WeixuZhuang/orgs","repos_url":"https://api.github.com/users/WeixuZhuang/repos","events_url":"https://api.github.com/users/WeixuZhuang/events{/privacy}","received_events_url":"https://api.github.com/users/WeixuZhuang/received_events","type":"User","site_admin":false},"body":"The code now calculates and find out the CIDRs for every node in any sync period.\r\nI will fix this TODO by maintaining a set for available CIDRs left. Firstly, I will\r\ninsert 256 CIDRs into the available set. Once someone get one CIDR, remove this CIDR\r\nfrom the available set. If one node get deleted, we will reinsert the CIDR associates\r\nwith this node back to available CIDR. Once there are nothing left in available CIDR set,\r\ngenerate another 256 CIDRs and insert them into the available set. As a result, we do not\r\nneed to generate CIDRs in every monitor process and we only need to assign CIDR to node\r\nwhich does not have it.\r\n\r\nThis commit also fix the error that CIDR may overflow when we use the function\r\ngenerateCIDRs. There will be no more ip overflowing, all assigan CIDR will be valid","created_at":"2015-11-25T02:22:09Z","updated_at":"2015-11-30T20:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bcc120e4df994fdfe109a3220721904734da6f5","assignee":{"login":"gmarek","id":1703842,"avatar_url":"https://avatars.githubusercontent.com/u/1703842?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarek","html_url":"https://github.com/gmarek","followers_url":"https://api.github.com/users/gmarek/followers","following_url":"https://api.github.com/users/gmarek/following{/other_user}","gists_url":"https://api.github.com/users/gmarek/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarek/subscriptions","organizations_url":"https://api.github.com/users/gmarek/orgs","repos_url":"https://api.github.com/users/gmarek/repos","events_url":"https://api.github.com/users/gmarek/events{/privacy}","received_events_url":"https://api.github.com/users/gmarek/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17754/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/8d46210cb03a3fe5b66234b678bc28dbe108c539","head":{"label":"WeixuZhuang:node_controller","ref":"node_controller","sha":"8d46210cb03a3fe5b66234b678bc28dbe108c539","user":{"login":"WeixuZhuang","id":15804885,"avatar_url":"https://avatars.githubusercontent.com/u/15804885?v=3","gravatar_id":"","url":"https://api.github.com/users/WeixuZhuang","html_url":"https://github.com/WeixuZhuang","followers_url":"https://api.github.com/users/WeixuZhuang/followers","following_url":"https://api.github.com/users/WeixuZhuang/following{/other_user}","gists_url":"https://api.github.com/users/WeixuZhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/WeixuZhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeixuZhuang/subscriptions","organizations_url":"https://api.github.com/users/WeixuZhuang/orgs","repos_url":"https://api.github.com/users/WeixuZhuang/repos","events_url":"https://api.github.com/users/WeixuZhuang/events{/privacy}","received_events_url":"https://api.github.com/users/WeixuZhuang/received_events","type":"User","site_admin":false},"repo":{"id":46152765,"name":"kubernetes","full_name":"WeixuZhuang/kubernetes","owner":{"login":"WeixuZhuang","id":15804885,"avatar_url":"https://avatars.githubusercontent.com/u/15804885?v=3","gravatar_id":"","url":"https://api.github.com/users/WeixuZhuang","html_url":"https://github.com/WeixuZhuang","followers_url":"https://api.github.com/users/WeixuZhuang/followers","following_url":"https://api.github.com/users/WeixuZhuang/following{/other_user}","gists_url":"https://api.github.com/users/WeixuZhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/WeixuZhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeixuZhuang/subscriptions","organizations_url":"https://api.github.com/users/WeixuZhuang/orgs","repos_url":"https://api.github.com/users/WeixuZhuang/repos","events_url":"https://api.github.com/users/WeixuZhuang/events{/privacy}","received_events_url":"https://api.github.com/users/WeixuZhuang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WeixuZhuang/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/WeixuZhuang/kubernetes","forks_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/forks","keys_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/teams","hooks_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/events","assignees_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/tags","blobs_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/languages","stargazers_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/subscription","commits_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/merges","archive_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/downloads","issues_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/WeixuZhuang/kubernetes/releases{/id}","created_at":"2015-11-13T23:30:21Z","updated_at":"2015-11-13T23:31:21Z","pushed_at":"2015-11-30T19:52:09Z","git_url":"git://github.com/WeixuZhuang/kubernetes.git","ssh_url":"git@github.com:WeixuZhuang/kubernetes.git","clone_url":"https://github.com/WeixuZhuang/kubernetes.git","svn_url":"https://github.com/WeixuZhuang/kubernetes","homepage":"http://kubernetes.io","size":141339,"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":"6b358e43dd56856536b25d06d5d7f112aaf4dd08","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-11-30T18:30:46Z","pushed_at":"2015-11-30T20:15:34Z","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":290935,"stargazers_count":11534,"watchers_count":11534,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3099,"mirror_url":null,"open_issues_count":2467,"forks":3099,"open_issues":2467,"watchers":11534,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/17754"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/17754"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/17754/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17754/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/8d46210cb03a3fe5b66234b678bc28dbe108c539"}}}}