{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/83484787","pull_request_review_id":4328456,"id":83484787,"diff_hunk":"@@ -0,0 +1,91 @@\n+/*\n+Copyright 2014 The Kubernetes 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+\n+package cmd\n+\n+import (\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"os/exec\"\n+\n+\t\"github.com/spf13/cobra\"\n+\n+\t\"k8s.io/kubernetes/cmd/kubeadm/app/preflight\"\n+\tcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n+\t\"k8s.io/kubernetes/pkg/util/initsystem\"\n+)\n+\n+func NewCmdReset(out io.Writer) *cobra.Command {\n+\tvar skipPreFlight bool\n+\tcmd := &cobra.Command{\n+\t\tUse:   \"reset\",\n+\t\tShort: \"Revert the actions kubeadm init or join made to the machine\",\n+\t\tRun: func(cmd *cobra.Command, args []string) {\n+\t\t\terr := RunReset(out, cmd, skipPreFlight)\n+\t\t\tcmdutil.CheckErr(err)\n+\t\t},\n+\t}\n+\n+\tcmd.PersistentFlags().BoolVar(\n+\t\t&skipPreFlight, \"skip-preflight-checks\", false,\n+\t\t\"skip preflight checks normally run before modifying the system\",\n+\t)\n+\n+\treturn cmd\n+}\n+\n+func RunReset(out io.Writer, cmd *cobra.Command, skipPreFlight bool) error {\n+\n+\tif !skipPreFlight {\n+\t\tfmt.Println(\"Running pre-flight checks\")\n+\t\terr := preflight.RunResetCheck()\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t} else {\n+\t\tfmt.Println(\"Skipping pre-flight checks\")\n+\t}\n+\n+\tserviceToStop := \"kubelet\"\n+\tinitSystem := initsystem.GetInitSystem()\n+\tif initSystem != nil {\n+\t\tfmt.Printf(\"Stopping the %s service...\\n\", serviceToStop)\n+\t\tinitSystem.ServiceStop(serviceToStop)\n+\t} else {\n+\t\tfmt.Printf(\"no supported init system detected, skipping service checks for %s. kubeadm reset may not have full effect now.\\n\", serviceToStop)\n+\t}\n+\n+\tfmt.Printf(\"Unmounting directories in /var/lib/kubelet...\\n\")\n+\t// Don't check for errors here, since umount will return a non-zero exit code if there is no directories to umount\n+\texec.Command(\"sh\", \"-c\", \"cat /proc/mounts | awk '{print $2}' | grep '/var/lib/kubelet' | xargs umount\").Run()","path":"cmd/kubeadm/app/cmd/reset.go","position":74,"original_position":74,"commit_id":"7460ab2b90f9922bb0fbc1cfafc1850acb938c93","original_commit_id":"7460ab2b90f9922bb0fbc1cfafc1850acb938c93","user":{"login":"errordeveloper","id":251467,"avatar_url":"https://avatars.githubusercontent.com/u/251467?v=3","gravatar_id":"","url":"https://api.github.com/users/errordeveloper","html_url":"https://github.com/errordeveloper","followers_url":"https://api.github.com/users/errordeveloper/followers","following_url":"https://api.github.com/users/errordeveloper/following{/other_user}","gists_url":"https://api.github.com/users/errordeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/errordeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errordeveloper/subscriptions","organizations_url":"https://api.github.com/users/errordeveloper/orgs","repos_url":"https://api.github.com/users/errordeveloper/repos","events_url":"https://api.github.com/users/errordeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/errordeveloper/received_events","type":"User","site_admin":false},"body":"I think `find /var/lib/kubelet | xargs -n 1 findmnt -n -t tmpfs -o TARGET -T | uniq | xargs -r umount ` is cleaner.","created_at":"2016-10-14T19:16:07Z","updated_at":"2016-10-14T19:25:35Z","html_url":"https://github.com/kubernetes/kubernetes/pull/34807#discussion_r83484787","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/83484787"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/34807#discussion_r83484787"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807","id":89351652,"html_url":"https://github.com/kubernetes/kubernetes/pull/34807","diff_url":"https://github.com/kubernetes/kubernetes/pull/34807.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/34807.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/34807","number":34807,"state":"open","locked":false,"title":"Implement kubeadm reset","user":{"login":"luxas","id":5442475,"avatar_url":"https://avatars.githubusercontent.com/u/5442475?v=3","gravatar_id":"","url":"https://api.github.com/users/luxas","html_url":"https://github.com/luxas","followers_url":"https://api.github.com/users/luxas/followers","following_url":"https://api.github.com/users/luxas/following{/other_user}","gists_url":"https://api.github.com/users/luxas/gists{/gist_id}","starred_url":"https://api.github.com/users/luxas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luxas/subscriptions","organizations_url":"https://api.github.com/users/luxas/orgs","repos_url":"https://api.github.com/users/luxas/repos","events_url":"https://api.github.com/users/luxas/events{/privacy}","received_events_url":"https://api.github.com/users/luxas/received_events","type":"User","site_admin":false},"body":"@kubernetes/sig-cluster-lifecycle\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/34807)\n<!-- Reviewable:end -->\n","created_at":"2016-10-14T09:27:27Z","updated_at":"2016-10-14T19:25:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f670e863d8f14344846f0ba675facc8587bc430c","assignee":{"login":"errordeveloper","id":251467,"avatar_url":"https://avatars.githubusercontent.com/u/251467?v=3","gravatar_id":"","url":"https://api.github.com/users/errordeveloper","html_url":"https://github.com/errordeveloper","followers_url":"https://api.github.com/users/errordeveloper/followers","following_url":"https://api.github.com/users/errordeveloper/following{/other_user}","gists_url":"https://api.github.com/users/errordeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/errordeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errordeveloper/subscriptions","organizations_url":"https://api.github.com/users/errordeveloper/orgs","repos_url":"https://api.github.com/users/errordeveloper/repos","events_url":"https://api.github.com/users/errordeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/errordeveloper/received_events","type":"User","site_admin":false},"assignees":[{"login":"errordeveloper","id":251467,"avatar_url":"https://avatars.githubusercontent.com/u/251467?v=3","gravatar_id":"","url":"https://api.github.com/users/errordeveloper","html_url":"https://github.com/errordeveloper","followers_url":"https://api.github.com/users/errordeveloper/followers","following_url":"https://api.github.com/users/errordeveloper/following{/other_user}","gists_url":"https://api.github.com/users/errordeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/errordeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errordeveloper/subscriptions","organizations_url":"https://api.github.com/users/errordeveloper/orgs","repos_url":"https://api.github.com/users/errordeveloper/repos","events_url":"https://api.github.com/users/errordeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/errordeveloper/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/34807/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7460ab2b90f9922bb0fbc1cfafc1850acb938c93","head":{"label":"luxas:kubeadm_reset","ref":"kubeadm_reset","sha":"7460ab2b90f9922bb0fbc1cfafc1850acb938c93","user":{"login":"luxas","id":5442475,"avatar_url":"https://avatars.githubusercontent.com/u/5442475?v=3","gravatar_id":"","url":"https://api.github.com/users/luxas","html_url":"https://github.com/luxas","followers_url":"https://api.github.com/users/luxas/followers","following_url":"https://api.github.com/users/luxas/following{/other_user}","gists_url":"https://api.github.com/users/luxas/gists{/gist_id}","starred_url":"https://api.github.com/users/luxas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luxas/subscriptions","organizations_url":"https://api.github.com/users/luxas/orgs","repos_url":"https://api.github.com/users/luxas/repos","events_url":"https://api.github.com/users/luxas/events{/privacy}","received_events_url":"https://api.github.com/users/luxas/received_events","type":"User","site_admin":false},"repo":{"id":37801743,"name":"kubernetes","full_name":"luxas/kubernetes","owner":{"login":"luxas","id":5442475,"avatar_url":"https://avatars.githubusercontent.com/u/5442475?v=3","gravatar_id":"","url":"https://api.github.com/users/luxas","html_url":"https://github.com/luxas","followers_url":"https://api.github.com/users/luxas/followers","following_url":"https://api.github.com/users/luxas/following{/other_user}","gists_url":"https://api.github.com/users/luxas/gists{/gist_id}","starred_url":"https://api.github.com/users/luxas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luxas/subscriptions","organizations_url":"https://api.github.com/users/luxas/orgs","repos_url":"https://api.github.com/users/luxas/repos","events_url":"https://api.github.com/users/luxas/events{/privacy}","received_events_url":"https://api.github.com/users/luxas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luxas/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/luxas/kubernetes","forks_url":"https://api.github.com/repos/luxas/kubernetes/forks","keys_url":"https://api.github.com/repos/luxas/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luxas/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luxas/kubernetes/teams","hooks_url":"https://api.github.com/repos/luxas/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/luxas/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/luxas/kubernetes/events","assignees_url":"https://api.github.com/repos/luxas/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/luxas/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/luxas/kubernetes/tags","blobs_url":"https://api.github.com/repos/luxas/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luxas/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luxas/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/luxas/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luxas/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/luxas/kubernetes/languages","stargazers_url":"https://api.github.com/repos/luxas/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/luxas/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/luxas/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/luxas/kubernetes/subscription","commits_url":"https://api.github.com/repos/luxas/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/luxas/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/luxas/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/luxas/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/luxas/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/luxas/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luxas/kubernetes/merges","archive_url":"https://api.github.com/repos/luxas/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luxas/kubernetes/downloads","issues_url":"https://api.github.com/repos/luxas/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/luxas/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/luxas/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/luxas/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luxas/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/luxas/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/luxas/kubernetes/deployments","created_at":"2015-06-21T08:14:15Z","updated_at":"2016-01-11T14:11:00Z","pushed_at":"2016-10-14T09:26:24Z","git_url":"git://github.com/luxas/kubernetes.git","ssh_url":"git@github.com:luxas/kubernetes.git","clone_url":"https://github.com/luxas/kubernetes.git","svn_url":"https://github.com/luxas/kubernetes","homepage":"http://kubernetes.io","size":332885,"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":"0b74e39864690283996d0fe58d30977a2b1fc962","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-10-14T19:15:57Z","pushed_at":"2016-10-14T19:22:54Z","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":594409,"stargazers_count":17553,"watchers_count":17553,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5705,"mirror_url":null,"open_issues_count":4931,"forks":5705,"open_issues":4931,"watchers":17553,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/34807"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/34807"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/34807/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/34807/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7460ab2b90f9922bb0fbc1cfafc1850acb938c93"}}}}
{"actor":{"display_login":"errordeveloper"}}