{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41524331","id":41524331,"diff_hunk":"@@ -72,8 +73,23 @@ func (mounter *SafeFormatAndMount) Mount(source string, target string, fstype st\n func (mounter *SafeFormatAndMount) formatAndMount(source string, target string, fstype string, options []string) error {\n \toptions = append(options, \"defaults\")\n \n+\t// Run fsck on the disk to fix repairable issues\n+\targs := []string{\"-a\", source}\n+\tcmd := mounter.Runner.Command(\"fsck\", args...)\n+\tout, err := cmd.CombinedOutput()\n+\tif err != nil {\n+\t\tif ee, ok := err.(exec.ExitError); ok {\n+\t\t\tif ee.ExitStatus() == 1 {\n+\t\t\t\tglog.Infof(\"Device %s has errors which were corrected by fsck\", source)\n+\t\t\t}\n+\t\t\tif ee.ExitStatus() == 4 {\n+\t\t\t\treturn fmt.Errorf(\"'fsck' found errors on devie %s but did not correct them: %s\", source, string(out))\n+\t\t\t}","path":"pkg/util/mount/mount.go","position":23,"original_position":23,"commit_id":"66062f603f61518de58ba2b36c89dd0118caa4a5","original_commit_id":"66062f603f61518de58ba2b36c89dd0118caa4a5","user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"body":"It is more idiomatic Go to represent multiple Ifs or If/Elses as a switch.\r\n```\r\nswitch {\r\ncase ee.ExitStatus() == 1:\r\n\r\ncase ee.ExecStatus() == 4:\r\n}\r\n```","created_at":"2015-10-08T15:00:30Z","updated_at":"2015-10-08T15:00:30Z","html_url":"https://github.com/kubernetes/kubernetes/pull/14200#discussion_r41524331","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41524331"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14200#discussion_r41524331"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200","id":45454860,"html_url":"https://github.com/kubernetes/kubernetes/pull/14200","diff_url":"https://github.com/kubernetes/kubernetes/pull/14200.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/14200.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14200","number":14200,"state":"open","locked":false,"title":"Run fsck before formatting disk","user":{"login":"swagiaal","id":770962,"avatar_url":"https://avatars.githubusercontent.com/u/770962?v=3","gravatar_id":"","url":"https://api.github.com/users/swagiaal","html_url":"https://github.com/swagiaal","followers_url":"https://api.github.com/users/swagiaal/followers","following_url":"https://api.github.com/users/swagiaal/following{/other_user}","gists_url":"https://api.github.com/users/swagiaal/gists{/gist_id}","starred_url":"https://api.github.com/users/swagiaal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagiaal/subscriptions","organizations_url":"https://api.github.com/users/swagiaal/orgs","repos_url":"https://api.github.com/users/swagiaal/repos","events_url":"https://api.github.com/users/swagiaal/events{/privacy}","received_events_url":"https://api.github.com/users/swagiaal/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-18T21:29:13Z","updated_at":"2015-10-08T15:00:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d917166a443d5ba8ab376ffaede8adbeaa2272b","assignee":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14200/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/66062f603f61518de58ba2b36c89dd0118caa4a5","head":{"label":"swagiaal:run-fsck-before-format","ref":"run-fsck-before-format","sha":"66062f603f61518de58ba2b36c89dd0118caa4a5","user":{"login":"swagiaal","id":770962,"avatar_url":"https://avatars.githubusercontent.com/u/770962?v=3","gravatar_id":"","url":"https://api.github.com/users/swagiaal","html_url":"https://github.com/swagiaal","followers_url":"https://api.github.com/users/swagiaal/followers","following_url":"https://api.github.com/users/swagiaal/following{/other_user}","gists_url":"https://api.github.com/users/swagiaal/gists{/gist_id}","starred_url":"https://api.github.com/users/swagiaal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagiaal/subscriptions","organizations_url":"https://api.github.com/users/swagiaal/orgs","repos_url":"https://api.github.com/users/swagiaal/repos","events_url":"https://api.github.com/users/swagiaal/events{/privacy}","received_events_url":"https://api.github.com/users/swagiaal/received_events","type":"User","site_admin":false},"repo":{"id":29880614,"name":"kubernetes","full_name":"swagiaal/kubernetes","owner":{"login":"swagiaal","id":770962,"avatar_url":"https://avatars.githubusercontent.com/u/770962?v=3","gravatar_id":"","url":"https://api.github.com/users/swagiaal","html_url":"https://github.com/swagiaal","followers_url":"https://api.github.com/users/swagiaal/followers","following_url":"https://api.github.com/users/swagiaal/following{/other_user}","gists_url":"https://api.github.com/users/swagiaal/gists{/gist_id}","starred_url":"https://api.github.com/users/swagiaal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagiaal/subscriptions","organizations_url":"https://api.github.com/users/swagiaal/orgs","repos_url":"https://api.github.com/users/swagiaal/repos","events_url":"https://api.github.com/users/swagiaal/events{/privacy}","received_events_url":"https://api.github.com/users/swagiaal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swagiaal/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/swagiaal/kubernetes","forks_url":"https://api.github.com/repos/swagiaal/kubernetes/forks","keys_url":"https://api.github.com/repos/swagiaal/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swagiaal/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swagiaal/kubernetes/teams","hooks_url":"https://api.github.com/repos/swagiaal/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/swagiaal/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/swagiaal/kubernetes/events","assignees_url":"https://api.github.com/repos/swagiaal/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/swagiaal/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/swagiaal/kubernetes/tags","blobs_url":"https://api.github.com/repos/swagiaal/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swagiaal/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swagiaal/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/swagiaal/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swagiaal/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/swagiaal/kubernetes/languages","stargazers_url":"https://api.github.com/repos/swagiaal/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/swagiaal/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/swagiaal/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/swagiaal/kubernetes/subscription","commits_url":"https://api.github.com/repos/swagiaal/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/swagiaal/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/swagiaal/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/swagiaal/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/swagiaal/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/swagiaal/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swagiaal/kubernetes/merges","archive_url":"https://api.github.com/repos/swagiaal/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swagiaal/kubernetes/downloads","issues_url":"https://api.github.com/repos/swagiaal/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/swagiaal/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/swagiaal/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/swagiaal/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swagiaal/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/swagiaal/kubernetes/releases{/id}","created_at":"2015-01-26T20:41:58Z","updated_at":"2015-02-10T16:46:27Z","pushed_at":"2015-10-07T20:40:49Z","git_url":"git://github.com/swagiaal/kubernetes.git","ssh_url":"git@github.com:swagiaal/kubernetes.git","clone_url":"https://github.com/swagiaal/kubernetes.git","svn_url":"https://github.com/swagiaal/kubernetes","homepage":"http://kubernetes.io","size":112639,"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":"81ec641f15af65c7026d2600be515aaddc9f4d84","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-10-08T14:48:21Z","pushed_at":"2015-10-08T14:59:24Z","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":447415,"stargazers_count":10602,"watchers_count":10602,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2667,"mirror_url":null,"open_issues_count":2008,"forks":2667,"open_issues":2008,"watchers":10602,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14200"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14200"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14200/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14200/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/66062f603f61518de58ba2b36c89dd0118caa4a5"}}}}