{"action":"created","comment":{"url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/comments/224700173","pull_request_review_id":164133095,"id":224700173,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDcwMDE3Mw==","diff_hunk":"@@ -192,6 +192,20 @@ func IsPodDrained(pod *corev1.Pod) (bool, error) {\n \t\treturn false, microerror.Mask(err)\n \t}\n \n+\t// As a safety net check POD's container statuses. If all containers are\n+\t// Terminated, POD can be deleted even if annotation is missing still.","path":"service/controller/v14patch2/key/key.go","position":5,"original_position":5,"commit_id":"275a3f051881c221fe97d2340ce17e4ee592fc59","original_commit_id":"275a3f051881c221fe97d2340ce17e4ee592fc59","user":{"login":"xh3b4sd","id":552769,"node_id":"MDQ6VXNlcjU1Mjc2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/552769?v=4","gravatar_id":"","url":"https://api.github.com/users/xh3b4sd","html_url":"https://github.com/xh3b4sd","followers_url":"https://api.github.com/users/xh3b4sd/followers","following_url":"https://api.github.com/users/xh3b4sd/following{/other_user}","gists_url":"https://api.github.com/users/xh3b4sd/gists{/gist_id}","starred_url":"https://api.github.com/users/xh3b4sd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xh3b4sd/subscriptions","organizations_url":"https://api.github.com/users/xh3b4sd/orgs","repos_url":"https://api.github.com/users/xh3b4sd/repos","events_url":"https://api.github.com/users/xh3b4sd/events{/privacy}","received_events_url":"https://api.github.com/users/xh3b4sd/received_events","type":"User","site_admin":false},"body":"This is not true because above we return in case the annotation is missing. I am also thinking to have a separate method for this like `IsPodTerminated` or `IsPodDead` or something like this. We should not mix semantics here and rather have a dedicated check which we leverage where we need it. ","created_at":"2018-10-12T07:56:44Z","updated_at":"2018-10-12T07:56:50Z","html_url":"https://github.com/giantswarm/kvm-operator/pull/584#discussion_r224700173","pull_request_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/comments/224700173"},"html":{"href":"https://github.com/giantswarm/kvm-operator/pull/584#discussion_r224700173"},"pull_request":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584"}}},"pull_request":{"url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584","id":222361727,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMzYxNzI3","html_url":"https://github.com/giantswarm/kvm-operator/pull/584","diff_url":"https://github.com/giantswarm/kvm-operator/pull/584.diff","patch_url":"https://github.com/giantswarm/kvm-operator/pull/584.patch","issue_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/584","number":584,"state":"open","locked":false,"title":"Consider POD drained when all containers are Terminated","user":{"login":"tuommaki","id":1947505,"node_id":"MDQ6VXNlcjE5NDc1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/1947505?v=4","gravatar_id":"","url":"https://api.github.com/users/tuommaki","html_url":"https://github.com/tuommaki","followers_url":"https://api.github.com/users/tuommaki/followers","following_url":"https://api.github.com/users/tuommaki/following{/other_user}","gists_url":"https://api.github.com/users/tuommaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tuommaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuommaki/subscriptions","organizations_url":"https://api.github.com/users/tuommaki/orgs","repos_url":"https://api.github.com/users/tuommaki/repos","events_url":"https://api.github.com/users/tuommaki/events{/privacy}","received_events_url":"https://api.github.com/users/tuommaki/received_events","type":"User","site_admin":false},"body":"key.IsPodDraind() checks if POD contains annotation created by\r\nnode-operator. Due to race condition with deployment termination and\r\nnode draining, this occasionally fails. In case POD gets terminated\r\nbefore node-operator manages to drain it, consider POD drained when all\r\nof its containers are Terminated.","created_at":"2018-10-12T06:25:06Z","updated_at":"2018-10-12T07:56:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8923981d37936747d3a25438796ff46f962fbdf","assignee":{"login":"tuommaki","id":1947505,"node_id":"MDQ6VXNlcjE5NDc1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/1947505?v=4","gravatar_id":"","url":"https://api.github.com/users/tuommaki","html_url":"https://github.com/tuommaki","followers_url":"https://api.github.com/users/tuommaki/followers","following_url":"https://api.github.com/users/tuommaki/following{/other_user}","gists_url":"https://api.github.com/users/tuommaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tuommaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuommaki/subscriptions","organizations_url":"https://api.github.com/users/tuommaki/orgs","repos_url":"https://api.github.com/users/tuommaki/repos","events_url":"https://api.github.com/users/tuommaki/events{/privacy}","received_events_url":"https://api.github.com/users/tuommaki/received_events","type":"User","site_admin":false},"assignees":[{"login":"tuommaki","id":1947505,"node_id":"MDQ6VXNlcjE5NDc1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/1947505?v=4","gravatar_id":"","url":"https://api.github.com/users/tuommaki","html_url":"https://github.com/tuommaki","followers_url":"https://api.github.com/users/tuommaki/followers","following_url":"https://api.github.com/users/tuommaki/following{/other_user}","gists_url":"https://api.github.com/users/tuommaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tuommaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuommaki/subscriptions","organizations_url":"https://api.github.com/users/tuommaki/orgs","repos_url":"https://api.github.com/users/tuommaki/repos","events_url":"https://api.github.com/users/tuommaki/events{/privacy}","received_events_url":"https://api.github.com/users/tuommaki/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584/commits","review_comments_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584/comments","review_comment_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/584/comments","statuses_url":"https://api.github.com/repos/giantswarm/kvm-operator/statuses/275a3f051881c221fe97d2340ce17e4ee592fc59","head":{"label":"giantswarm:consider-pod-drained-when-all-containers-are-terminated","ref":"consider-pod-drained-when-all-containers-are-terminated","sha":"275a3f051881c221fe97d2340ce17e4ee592fc59","user":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":74021543,"node_id":"MDEwOlJlcG9zaXRvcnk3NDAyMTU0Mw==","name":"kvm-operator","full_name":"giantswarm/kvm-operator","private":false,"owner":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/giantswarm/kvm-operator","description":"Handles Kubernetes clusters running on a Kubernetes cluster with workers and masters in KVMs on bare metal","fork":false,"url":"https://api.github.com/repos/giantswarm/kvm-operator","forks_url":"https://api.github.com/repos/giantswarm/kvm-operator/forks","keys_url":"https://api.github.com/repos/giantswarm/kvm-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/kvm-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/kvm-operator/teams","hooks_url":"https://api.github.com/repos/giantswarm/kvm-operator/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/kvm-operator/events","assignees_url":"https://api.github.com/repos/giantswarm/kvm-operator/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/kvm-operator/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/kvm-operator/tags","blobs_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/kvm-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/kvm-operator/languages","stargazers_url":"https://api.github.com/repos/giantswarm/kvm-operator/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/kvm-operator/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/kvm-operator/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/kvm-operator/subscription","commits_url":"https://api.github.com/repos/giantswarm/kvm-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/kvm-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/kvm-operator/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/kvm-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/kvm-operator/merges","archive_url":"https://api.github.com/repos/giantswarm/kvm-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/kvm-operator/downloads","issues_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/kvm-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/kvm-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/kvm-operator/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/kvm-operator/releases{/id}","deployments_url":"https://api.github.com/repos/giantswarm/kvm-operator/deployments","created_at":"2016-11-17T11:40:50Z","updated_at":"2018-10-12T07:30:05Z","pushed_at":"2018-10-12T07:43:45Z","git_url":"git://github.com/giantswarm/kvm-operator.git","ssh_url":"git@github.com:giantswarm/kvm-operator.git","clone_url":"https://github.com/giantswarm/kvm-operator.git","svn_url":"https://github.com/giantswarm/kvm-operator","homepage":"https://godoc.org/github.com/giantswarm/kvm-operator","size":63367,"stargazers_count":30,"watchers_count":30,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":7,"open_issues":20,"watchers":30,"default_branch":"master"}},"base":{"label":"giantswarm:master","ref":"master","sha":"9624a09f117f9ec1a1cb42d1fe1777c3d3617f9f","user":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"repo":{"id":74021543,"node_id":"MDEwOlJlcG9zaXRvcnk3NDAyMTU0Mw==","name":"kvm-operator","full_name":"giantswarm/kvm-operator","private":false,"owner":{"login":"giantswarm","id":7556340,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1NTYzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7556340?v=4","gravatar_id":"","url":"https://api.github.com/users/giantswarm","html_url":"https://github.com/giantswarm","followers_url":"https://api.github.com/users/giantswarm/followers","following_url":"https://api.github.com/users/giantswarm/following{/other_user}","gists_url":"https://api.github.com/users/giantswarm/gists{/gist_id}","starred_url":"https://api.github.com/users/giantswarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giantswarm/subscriptions","organizations_url":"https://api.github.com/users/giantswarm/orgs","repos_url":"https://api.github.com/users/giantswarm/repos","events_url":"https://api.github.com/users/giantswarm/events{/privacy}","received_events_url":"https://api.github.com/users/giantswarm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/giantswarm/kvm-operator","description":"Handles Kubernetes clusters running on a Kubernetes cluster with workers and masters in KVMs on bare metal","fork":false,"url":"https://api.github.com/repos/giantswarm/kvm-operator","forks_url":"https://api.github.com/repos/giantswarm/kvm-operator/forks","keys_url":"https://api.github.com/repos/giantswarm/kvm-operator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giantswarm/kvm-operator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giantswarm/kvm-operator/teams","hooks_url":"https://api.github.com/repos/giantswarm/kvm-operator/hooks","issue_events_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/events{/number}","events_url":"https://api.github.com/repos/giantswarm/kvm-operator/events","assignees_url":"https://api.github.com/repos/giantswarm/kvm-operator/assignees{/user}","branches_url":"https://api.github.com/repos/giantswarm/kvm-operator/branches{/branch}","tags_url":"https://api.github.com/repos/giantswarm/kvm-operator/tags","blobs_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/refs{/sha}","trees_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giantswarm/kvm-operator/statuses/{sha}","languages_url":"https://api.github.com/repos/giantswarm/kvm-operator/languages","stargazers_url":"https://api.github.com/repos/giantswarm/kvm-operator/stargazers","contributors_url":"https://api.github.com/repos/giantswarm/kvm-operator/contributors","subscribers_url":"https://api.github.com/repos/giantswarm/kvm-operator/subscribers","subscription_url":"https://api.github.com/repos/giantswarm/kvm-operator/subscription","commits_url":"https://api.github.com/repos/giantswarm/kvm-operator/commits{/sha}","git_commits_url":"https://api.github.com/repos/giantswarm/kvm-operator/git/commits{/sha}","comments_url":"https://api.github.com/repos/giantswarm/kvm-operator/comments{/number}","issue_comment_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues/comments{/number}","contents_url":"https://api.github.com/repos/giantswarm/kvm-operator/contents/{+path}","compare_url":"https://api.github.com/repos/giantswarm/kvm-operator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giantswarm/kvm-operator/merges","archive_url":"https://api.github.com/repos/giantswarm/kvm-operator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giantswarm/kvm-operator/downloads","issues_url":"https://api.github.com/repos/giantswarm/kvm-operator/issues{/number}","pulls_url":"https://api.github.com/repos/giantswarm/kvm-operator/pulls{/number}","milestones_url":"https://api.github.com/repos/giantswarm/kvm-operator/milestones{/number}","notifications_url":"https://api.github.com/repos/giantswarm/kvm-operator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giantswarm/kvm-operator/labels{/name}","releases_url":"https://api.github.com/repos/giantswarm/kvm-operator/releases{/id}","deployments_url":"https://api.github.com/repos/giantswarm/kvm-operator/deployments","created_at":"2016-11-17T11:40:50Z","updated_at":"2018-10-12T07:30:05Z","pushed_at":"2018-10-12T07:43:45Z","git_url":"git://github.com/giantswarm/kvm-operator.git","ssh_url":"git@github.com:giantswarm/kvm-operator.git","clone_url":"https://github.com/giantswarm/kvm-operator.git","svn_url":"https://github.com/giantswarm/kvm-operator","homepage":"https://godoc.org/github.com/giantswarm/kvm-operator","size":63367,"stargazers_count":30,"watchers_count":30,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":7,"open_issues":20,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584"},"html":{"href":"https://github.com/giantswarm/kvm-operator/pull/584"},"issue":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/issues/584"},"comments":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/issues/584/comments"},"review_comments":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584/comments"},"review_comment":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/pulls/584/commits"},"statuses":{"href":"https://api.github.com/repos/giantswarm/kvm-operator/statuses/275a3f051881c221fe97d2340ce17e4ee592fc59"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"xh3b4sd"}}