{"action":"closed","number":20264,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264","id":57473931,"html_url":"https://github.com/kubernetes/kubernetes/pull/20264","diff_url":"https://github.com/kubernetes/kubernetes/pull/20264.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/20264.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/20264","number":20264,"state":"closed","locked":false,"title":"Cleanup duplicated code in config.go","user":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"body":"I noticed that the code for `ADD` and `UPDATE` is really similar with that for `SET` in config.go.\r\n\r\nFor change like #18546 and #18410, we have to copy the same code to two different places, which is really annoying and a little ugly.\r\n\r\nIn this PR, I move the similar code to a simple function so as to cleanup the code a bit.\r\n\r\n@yujuhong ","created_at":"2016-01-28T09:12:09Z","updated_at":"2016-01-30T20:06:04Z","closed_at":"2016-01-30T20:06:04Z","merged_at":"2016-01-30T20:06:04Z","merge_commit_sha":"f0ddea26f24180aa7e47d288b5e7095cc045e5bf","assignee":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/20264/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/488e14a5a9e2ee2ce3105321b84fc15fe5126d4c","head":{"label":"Random-Liu:cleanup-config","ref":"cleanup-config","sha":"488e14a5a9e2ee2ce3105321b84fc15fe5126d4c","user":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"repo":{"id":44042241,"name":"kubernetes","full_name":"Random-Liu/kubernetes","owner":{"login":"Random-Liu","id":5821883,"avatar_url":"https://avatars.githubusercontent.com/u/5821883?v=3","gravatar_id":"","url":"https://api.github.com/users/Random-Liu","html_url":"https://github.com/Random-Liu","followers_url":"https://api.github.com/users/Random-Liu/followers","following_url":"https://api.github.com/users/Random-Liu/following{/other_user}","gists_url":"https://api.github.com/users/Random-Liu/gists{/gist_id}","starred_url":"https://api.github.com/users/Random-Liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Random-Liu/subscriptions","organizations_url":"https://api.github.com/users/Random-Liu/orgs","repos_url":"https://api.github.com/users/Random-Liu/repos","events_url":"https://api.github.com/users/Random-Liu/events{/privacy}","received_events_url":"https://api.github.com/users/Random-Liu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Random-Liu/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/Random-Liu/kubernetes","forks_url":"https://api.github.com/repos/Random-Liu/kubernetes/forks","keys_url":"https://api.github.com/repos/Random-Liu/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Random-Liu/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Random-Liu/kubernetes/teams","hooks_url":"https://api.github.com/repos/Random-Liu/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/Random-Liu/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/Random-Liu/kubernetes/events","assignees_url":"https://api.github.com/repos/Random-Liu/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/Random-Liu/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/Random-Liu/kubernetes/tags","blobs_url":"https://api.github.com/repos/Random-Liu/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Random-Liu/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Random-Liu/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Random-Liu/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Random-Liu/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/Random-Liu/kubernetes/languages","stargazers_url":"https://api.github.com/repos/Random-Liu/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/Random-Liu/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/Random-Liu/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/Random-Liu/kubernetes/subscription","commits_url":"https://api.github.com/repos/Random-Liu/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Random-Liu/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Random-Liu/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Random-Liu/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Random-Liu/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/Random-Liu/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Random-Liu/kubernetes/merges","archive_url":"https://api.github.com/repos/Random-Liu/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Random-Liu/kubernetes/downloads","issues_url":"https://api.github.com/repos/Random-Liu/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/Random-Liu/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/Random-Liu/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/Random-Liu/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Random-Liu/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/Random-Liu/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/Random-Liu/kubernetes/deployments","created_at":"2015-10-11T06:51:00Z","updated_at":"2015-10-11T06:51:16Z","pushed_at":"2016-01-30T19:36:10Z","git_url":"git://github.com/Random-Liu/kubernetes.git","ssh_url":"git@github.com:Random-Liu/kubernetes.git","clone_url":"https://github.com/Random-Liu/kubernetes.git","svn_url":"https://github.com/Random-Liu/kubernetes","homepage":"http://kubernetes.io","size":153240,"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":"458eb5284abd6933c620ba8ea383032f225e0885","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}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-01-30T19:19:44Z","pushed_at":"2016-01-30T20:06:04Z","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":313888,"stargazers_count":12429,"watchers_count":12429,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3519,"mirror_url":null,"open_issues_count":2815,"forks":3519,"open_issues":2815,"watchers":12429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/20264"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/20264"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/20264/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20264/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/488e14a5a9e2ee2ce3105321b84fc15fe5126d4c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"k8s-merge-robot","id":13653959,"avatar_url":"https://avatars.githubusercontent.com/u/13653959?v=3","gravatar_id":"","url":"https://api.github.com/users/k8s-merge-robot","html_url":"https://github.com/k8s-merge-robot","followers_url":"https://api.github.com/users/k8s-merge-robot/followers","following_url":"https://api.github.com/users/k8s-merge-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-merge-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-merge-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-merge-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-merge-robot/orgs","repos_url":"https://api.github.com/users/k8s-merge-robot/repos","events_url":"https://api.github.com/users/k8s-merge-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-merge-robot/received_events","type":"User","site_admin":false},"comments":10,"review_comments":0,"commits":1,"additions":19,"deletions":44,"changed_files":1}}