{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd-operator/pulls/comments/98147050","pull_request_review_id":18780218,"id":98147050,"diff_hunk":"@@ -0,0 +1,52 @@\n+// Copyright 2017 The etcd-operator Authors\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package garbagecollection\n+\n+import (\n+\t\"github.com/Sirupsen/logrus\"\n+\t\"github.com/coreos/etcd-operator/pkg/util/etcdutil\"\n+\t\"github.com/coreos/etcd-operator/pkg/util/k8sutil\"\n+\t\"k8s.io/client-go/1.5/kubernetes\"\n+)\n+\n+// CollectDeadMemberServices removes given cluster's member services whose corresponding members\n+// not belonging to given membership.\n+// These garbage services could have been left due to failure cases like:\n+// - created a service but failed to create the pod\n+// - failed to remove the service before\n+func CollectDeadMemberServices(clusterName, ns string, kubecli kubernetes.Interface, members etcdutil.MemberSet, logger *logrus.Entry) {\n+\topt := k8sutil.ClusterListOpt(clusterName)\n+\tsvcList, err := kubecli.Core().Services(ns).List(opt)\n+\tif err != nil {\n+\t\tlogger.Errorf(\"CollectDeadMemberServices: fail to list services: %v\", err)\n+\t\treturn\n+\t}\n+\tfor i := range svcList.Items {\n+\t\tsvc := svcList.Items[i]\n+\t\tname, ok := svc.Labels[\"etcd_node\"]","path":"pkg/garbagecollection/util.go","position":39,"original_position":38,"commit_id":"0310c46235a9ae9901dcb9b9eed26e924e9cbdc4","original_commit_id":"c6dddcbc31082fcf0e3ee080d7ee05830f8e5f0c","user":{"login":"xiang90","id":4479947,"avatar_url":"https://avatars.githubusercontent.com/u/4479947?v=3","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},"body":"ok. great.","created_at":"2017-01-27T05:37:07Z","updated_at":"2017-01-27T05:37:07Z","html_url":"https://github.com/coreos/etcd-operator/pull/680#discussion_r98147050","pull_request_url":"https://api.github.com/repos/coreos/etcd-operator/pulls/680","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/comments/98147050"},"html":{"href":"https://github.com/coreos/etcd-operator/pull/680#discussion_r98147050"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/680"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd-operator/pulls/680","id":103363382,"html_url":"https://github.com/coreos/etcd-operator/pull/680","diff_url":"https://github.com/coreos/etcd-operator/pull/680.diff","patch_url":"https://github.com/coreos/etcd-operator/pull/680.patch","issue_url":"https://api.github.com/repos/coreos/etcd-operator/issues/680","number":680,"state":"open","locked":false,"title":"\t cluster: gc dead member services periodically","user":{"login":"hongchaodeng","id":920884,"avatar_url":"https://avatars.githubusercontent.com/u/920884?v=3","gravatar_id":"","url":"https://api.github.com/users/hongchaodeng","html_url":"https://github.com/hongchaodeng","followers_url":"https://api.github.com/users/hongchaodeng/followers","following_url":"https://api.github.com/users/hongchaodeng/following{/other_user}","gists_url":"https://api.github.com/users/hongchaodeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hongchaodeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongchaodeng/subscriptions","organizations_url":"https://api.github.com/users/hongchaodeng/orgs","repos_url":"https://api.github.com/users/hongchaodeng/repos","events_url":"https://api.github.com/users/hongchaodeng/events{/privacy}","received_events_url":"https://api.github.com/users/hongchaodeng/received_events","type":"User","site_admin":false},"body":"fix https://github.com/coreos/etcd-operator/issues/290","created_at":"2017-01-26T18:35:40Z","updated_at":"2017-01-27T05:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0bec3d385a0328479d3e5f6e6de1d79b93a7b08","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd-operator/pulls/680/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd-operator/pulls/680/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd-operator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd-operator/issues/680/comments","statuses_url":"https://api.github.com/repos/coreos/etcd-operator/statuses/0310c46235a9ae9901dcb9b9eed26e924e9cbdc4","head":{"label":"hongchaodeng:s","ref":"s","sha":"0310c46235a9ae9901dcb9b9eed26e924e9cbdc4","user":{"login":"hongchaodeng","id":920884,"avatar_url":"https://avatars.githubusercontent.com/u/920884?v=3","gravatar_id":"","url":"https://api.github.com/users/hongchaodeng","html_url":"https://github.com/hongchaodeng","followers_url":"https://api.github.com/users/hongchaodeng/followers","following_url":"https://api.github.com/users/hongchaodeng/following{/other_user}","gists_url":"https://api.github.com/users/hongchaodeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hongchaodeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongchaodeng/subscriptions","organizations_url":"https://api.github.com/users/hongchaodeng/orgs","repos_url":"https://api.github.com/users/hongchaodeng/repos","events_url":"https://api.github.com/users/hongchaodeng/events{/privacy}","received_events_url":"https://api.github.com/users/hongchaodeng/received_events","type":"User","site_admin":false},"repo":{"id":72786503,"name":"etcd-operator","full_name":"hongchaodeng/etcd-operator","owner":{"login":"hongchaodeng","id":920884,"avatar_url":"https://avatars.githubusercontent.com/u/920884?v=3","gravatar_id":"","url":"https://api.github.com/users/hongchaodeng","html_url":"https://github.com/hongchaodeng","followers_url":"https://api.github.com/users/hongchaodeng/followers","following_url":"https://api.github.com/users/hongchaodeng/following{/other_user}","gists_url":"https://api.github.com/users/hongchaodeng/gists{/gist_id}","starred_url":"https://api.github.com/users/hongchaodeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongchaodeng/subscriptions","organizations_url":"https://api.github.com/users/hongchaodeng/orgs","repos_url":"https://api.github.com/users/hongchaodeng/repos","events_url":"https://api.github.com/users/hongchaodeng/events{/privacy}","received_events_url":"https://api.github.com/users/hongchaodeng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hongchaodeng/etcd-operator","description":"etcd Operator creates/configures/manages etcd clusters atop Kubernetes","fork":true,"url":"https://api.github.com/repos/hongchaodeng/etcd-operator","forks_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/forks","keys_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/teams","hooks_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/hooks","issue_events_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/issues/events{/number}","events_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/events","assignees_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/assignees{/user}","branches_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/branches{/branch}","tags_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/tags","blobs_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/languages","stargazers_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/stargazers","contributors_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/contributors","subscribers_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/subscribers","subscription_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/subscription","commits_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/contents/{+path}","compare_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/merges","archive_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/downloads","issues_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/issues{/number}","pulls_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/labels{/name}","releases_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/releases{/id}","deployments_url":"https://api.github.com/repos/hongchaodeng/etcd-operator/deployments","created_at":"2016-11-03T21:01:55Z","updated_at":"2016-11-03T21:01:56Z","pushed_at":"2017-01-27T05:35:25Z","git_url":"git://github.com/hongchaodeng/etcd-operator.git","ssh_url":"git@github.com:hongchaodeng/etcd-operator.git","clone_url":"https://github.com/hongchaodeng/etcd-operator.git","svn_url":"https://github.com/hongchaodeng/etcd-operator","homepage":"https://coreos.com/blog/introducing-the-etcd-operator.html","size":4784,"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":"coreos:master","ref":"master","sha":"d93a832e8474db116e2d4a96b3e052193ef4d642","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":64974719,"name":"etcd-operator","full_name":"coreos/etcd-operator","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/etcd-operator","description":"etcd operator creates/configures/manages etcd clusters atop Kubernetes","fork":false,"url":"https://api.github.com/repos/coreos/etcd-operator","forks_url":"https://api.github.com/repos/coreos/etcd-operator/forks","keys_url":"https://api.github.com/repos/coreos/etcd-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/etcd-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/etcd-operator/teams","hooks_url":"https://api.github.com/repos/coreos/etcd-operator/hooks","issue_events_url":"https://api.github.com/repos/coreos/etcd-operator/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/etcd-operator/events","assignees_url":"https://api.github.com/repos/coreos/etcd-operator/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/etcd-operator/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/etcd-operator/tags","blobs_url":"https://api.github.com/repos/coreos/etcd-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/etcd-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/etcd-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/etcd-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/etcd-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/etcd-operator/languages","stargazers_url":"https://api.github.com/repos/coreos/etcd-operator/stargazers","contributors_url":"https://api.github.com/repos/coreos/etcd-operator/contributors","subscribers_url":"https://api.github.com/repos/coreos/etcd-operator/subscribers","subscription_url":"https://api.github.com/repos/coreos/etcd-operator/subscription","commits_url":"https://api.github.com/repos/coreos/etcd-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/etcd-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/etcd-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/etcd-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/etcd-operator/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/etcd-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/etcd-operator/merges","archive_url":"https://api.github.com/repos/coreos/etcd-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/etcd-operator/downloads","issues_url":"https://api.github.com/repos/coreos/etcd-operator/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/etcd-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/etcd-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/etcd-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/etcd-operator/labels{/name}","releases_url":"https://api.github.com/repos/coreos/etcd-operator/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/etcd-operator/deployments","created_at":"2016-08-04T23:54:58Z","updated_at":"2017-01-25T07:58:09Z","pushed_at":"2017-01-27T05:35:23Z","git_url":"git://github.com/coreos/etcd-operator.git","ssh_url":"git@github.com:coreos/etcd-operator.git","clone_url":"https://github.com/coreos/etcd-operator.git","svn_url":"https://github.com/coreos/etcd-operator","homepage":"https://coreos.com/blog/introducing-the-etcd-operator.html","size":1309,"stargazers_count":177,"watchers_count":177,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":32,"forks":28,"open_issues":32,"watchers":177,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/680"},"html":{"href":"https://github.com/coreos/etcd-operator/pull/680"},"issue":{"href":"https://api.github.com/repos/coreos/etcd-operator/issues/680"},"comments":{"href":"https://api.github.com/repos/coreos/etcd-operator/issues/680/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/680/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd-operator/pulls/680/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd-operator/statuses/0310c46235a9ae9901dcb9b9eed26e924e9cbdc4"}}}}
{"actor":{"display_login":"xiang90"}}