{"action":"created","comment":{"url":"https://api.github.com/repos/tigera/libcalico-go/pulls/comments/80808144","pull_request_review_id":1837196,"id":80808144,"diff_hunk":"@@ -0,0 +1,220 @@\n+// Copyright (c) 2016 Tigera, Inc. All rights reserved.\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 node\n+\n+import (\n+\t\"bufio\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"log\"\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"regexp\"\n+\t\"strings\"\n+\n+\tdocopt \"github.com/docopt/docopt-go\"\n+\tgoversion \"github.com/mcuadros/go-version\"\n+)\n+\n+// The minimum allowed linux kernel version is 2.6.24, which introduced network\n+// namespaces and veth pairs.\n+const minKernelVersion = \"2.6.24\"\n+\n+// Required kernel modules to run Calico\n+var requiredModules = []string{\"xt_set\", \"ip6_tables\"}\n+\n+// Checksystem checks host system for compatible versions\n+func Checksystem() error {\n+\tdoc := `Usage: \n+    calicoctl checksystem\n+\n+Description:\n+    Check for compatibility with the host system\n+`\n+\n+\t// Note: This call is ignoring the error because error check happens at the level above\n+\t// i.e at `node.go` before it calls `node.Status`. This call is just so help message gets\n+\t// printed for this option\n+\t_, _ = docopt.Parse(doc, nil, true, \"calicoctl\", false, false)\n+\n+\t// Make sure the command is run with super user priviladges\n+\tif os.Getuid() != 0 {\n+\t\tfmt.Println(\"Need super user privilages: Operation not permitted\")\n+\t\tos.Exit(1)\n+\t}\n+\n+\tsystemOk := true\n+\n+\tfmt.Print(\"Checking kernel version...\\n\")\n+\terr := checkKernelVersion()\n+\tif err != nil {\n+\t\tsystemOk = false\n+\t}\n+\n+\tfmt.Print(\"Checking kernel modules...\\n\")\n+\terr = checkKernelModules()\n+\tif err != nil {\n+\t\tsystemOk = false\n+\t}\n+\n+\t// If any of the checks fail, print a message and exit\n+\tif !systemOk {\n+\t\tfmt.Printf(\"%-20s\\t\\t\\t%s\", \"System doesn't meet one or more minimum systems requirements to run Calico\", \"FAIL\\n\")","path":"calicoctl/commands/node/checksystem.go","position":74,"original_position":74,"commit_id":"f9de92563bf5edccbb9d5723f5a599db6d78fcd7","original_commit_id":"f9de92563bf5edccbb9d5723f5a599db6d78fcd7","user":{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false},"body":"it is so the `OK` and `FAIL` line up with other `OK` and `FAIL`s ","created_at":"2016-09-27T22:16:03Z","updated_at":"2016-09-27T22:16:03Z","html_url":"https://github.com/tigera/libcalico-go/pull/143#discussion_r80808144","pull_request_url":"https://api.github.com/repos/tigera/libcalico-go/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/comments/80808144"},"html":{"href":"https://github.com/tigera/libcalico-go/pull/143#discussion_r80808144"},"pull_request":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/tigera/libcalico-go/pulls/143","id":86566616,"html_url":"https://github.com/tigera/libcalico-go/pull/143","diff_url":"https://github.com/tigera/libcalico-go/pull/143.diff","patch_url":"https://github.com/tigera/libcalico-go/pull/143.patch","issue_url":"https://api.github.com/repos/tigera/libcalico-go/issues/143","number":143,"state":"open","locked":false,"title":"calicoctl checksystem command","user":{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false},"body":"For issue #85 ","created_at":"2016-09-23T19:18:39Z","updated_at":"2016-09-27T22:16:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44adeb8b4d0a2a51c82ea937ef7a4bd0378fafd0","assignee":{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false},"assignees":[{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tigera/libcalico-go/milestones/2","html_url":"https://github.com/tigera/libcalico-go/milestones/calicoctl/GA","labels_url":"https://api.github.com/repos/tigera/libcalico-go/milestones/2/labels","id":1952255,"number":2,"title":"calicoctl/GA","description":"First GA release of calicoctl Go binary.","creator":{"login":"caseydavenport","id":1944093,"avatar_url":"https://avatars.githubusercontent.com/u/1944093?v=3","gravatar_id":"","url":"https://api.github.com/users/caseydavenport","html_url":"https://github.com/caseydavenport","followers_url":"https://api.github.com/users/caseydavenport/followers","following_url":"https://api.github.com/users/caseydavenport/following{/other_user}","gists_url":"https://api.github.com/users/caseydavenport/gists{/gist_id}","starred_url":"https://api.github.com/users/caseydavenport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseydavenport/subscriptions","organizations_url":"https://api.github.com/users/caseydavenport/orgs","repos_url":"https://api.github.com/users/caseydavenport/repos","events_url":"https://api.github.com/users/caseydavenport/events{/privacy}","received_events_url":"https://api.github.com/users/caseydavenport/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":6,"state":"open","created_at":"2016-08-19T20:19:54Z","updated_at":"2016-09-27T20:29:22Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/tigera/libcalico-go/pulls/143/commits","review_comments_url":"https://api.github.com/repos/tigera/libcalico-go/pulls/143/comments","review_comment_url":"https://api.github.com/repos/tigera/libcalico-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tigera/libcalico-go/issues/143/comments","statuses_url":"https://api.github.com/repos/tigera/libcalico-go/statuses/f9de92563bf5edccbb9d5723f5a599db6d78fcd7","head":{"label":"gunjan5:checksystem","ref":"checksystem","sha":"f9de92563bf5edccbb9d5723f5a599db6d78fcd7","user":{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false},"repo":{"id":67251212,"name":"libcalico-go","full_name":"gunjan5/libcalico-go","owner":{"login":"gunjan5","id":5966968,"avatar_url":"https://avatars.githubusercontent.com/u/5966968?v=3","gravatar_id":"","url":"https://api.github.com/users/gunjan5","html_url":"https://github.com/gunjan5","followers_url":"https://api.github.com/users/gunjan5/followers","following_url":"https://api.github.com/users/gunjan5/following{/other_user}","gists_url":"https://api.github.com/users/gunjan5/gists{/gist_id}","starred_url":"https://api.github.com/users/gunjan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunjan5/subscriptions","organizations_url":"https://api.github.com/users/gunjan5/orgs","repos_url":"https://api.github.com/users/gunjan5/repos","events_url":"https://api.github.com/users/gunjan5/events{/privacy}","received_events_url":"https://api.github.com/users/gunjan5/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gunjan5/libcalico-go","description":"Golang Calico library functions:  https://www.projectcalico.org","fork":true,"url":"https://api.github.com/repos/gunjan5/libcalico-go","forks_url":"https://api.github.com/repos/gunjan5/libcalico-go/forks","keys_url":"https://api.github.com/repos/gunjan5/libcalico-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gunjan5/libcalico-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gunjan5/libcalico-go/teams","hooks_url":"https://api.github.com/repos/gunjan5/libcalico-go/hooks","issue_events_url":"https://api.github.com/repos/gunjan5/libcalico-go/issues/events{/number}","events_url":"https://api.github.com/repos/gunjan5/libcalico-go/events","assignees_url":"https://api.github.com/repos/gunjan5/libcalico-go/assignees{/user}","branches_url":"https://api.github.com/repos/gunjan5/libcalico-go/branches{/branch}","tags_url":"https://api.github.com/repos/gunjan5/libcalico-go/tags","blobs_url":"https://api.github.com/repos/gunjan5/libcalico-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gunjan5/libcalico-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gunjan5/libcalico-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/gunjan5/libcalico-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gunjan5/libcalico-go/statuses/{sha}","languages_url":"https://api.github.com/repos/gunjan5/libcalico-go/languages","stargazers_url":"https://api.github.com/repos/gunjan5/libcalico-go/stargazers","contributors_url":"https://api.github.com/repos/gunjan5/libcalico-go/contributors","subscribers_url":"https://api.github.com/repos/gunjan5/libcalico-go/subscribers","subscription_url":"https://api.github.com/repos/gunjan5/libcalico-go/subscription","commits_url":"https://api.github.com/repos/gunjan5/libcalico-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/gunjan5/libcalico-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/gunjan5/libcalico-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/gunjan5/libcalico-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/gunjan5/libcalico-go/contents/{+path}","compare_url":"https://api.github.com/repos/gunjan5/libcalico-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gunjan5/libcalico-go/merges","archive_url":"https://api.github.com/repos/gunjan5/libcalico-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gunjan5/libcalico-go/downloads","issues_url":"https://api.github.com/repos/gunjan5/libcalico-go/issues{/number}","pulls_url":"https://api.github.com/repos/gunjan5/libcalico-go/pulls{/number}","milestones_url":"https://api.github.com/repos/gunjan5/libcalico-go/milestones{/number}","notifications_url":"https://api.github.com/repos/gunjan5/libcalico-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gunjan5/libcalico-go/labels{/name}","releases_url":"https://api.github.com/repos/gunjan5/libcalico-go/releases{/id}","deployments_url":"https://api.github.com/repos/gunjan5/libcalico-go/deployments","created_at":"2016-09-02T20:00:33Z","updated_at":"2016-09-02T20:00:34Z","pushed_at":"2016-09-27T22:11:50Z","git_url":"git://github.com/gunjan5/libcalico-go.git","ssh_url":"git@github.com:gunjan5/libcalico-go.git","clone_url":"https://github.com/gunjan5/libcalico-go.git","svn_url":"https://github.com/gunjan5/libcalico-go","homepage":null,"size":29660,"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":"tigera:master","ref":"master","sha":"d67dcf4f75f19ec825dc8dd950bd9fb148c93cfa","user":{"login":"tigera","id":18633690,"avatar_url":"https://avatars.githubusercontent.com/u/18633690?v=3","gravatar_id":"","url":"https://api.github.com/users/tigera","html_url":"https://github.com/tigera","followers_url":"https://api.github.com/users/tigera/followers","following_url":"https://api.github.com/users/tigera/following{/other_user}","gists_url":"https://api.github.com/users/tigera/gists{/gist_id}","starred_url":"https://api.github.com/users/tigera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigera/subscriptions","organizations_url":"https://api.github.com/users/tigera/orgs","repos_url":"https://api.github.com/users/tigera/repos","events_url":"https://api.github.com/users/tigera/events{/privacy}","received_events_url":"https://api.github.com/users/tigera/received_events","type":"Organization","site_admin":false},"repo":{"id":63438319,"name":"libcalico-go","full_name":"tigera/libcalico-go","owner":{"login":"tigera","id":18633690,"avatar_url":"https://avatars.githubusercontent.com/u/18633690?v=3","gravatar_id":"","url":"https://api.github.com/users/tigera","html_url":"https://github.com/tigera","followers_url":"https://api.github.com/users/tigera/followers","following_url":"https://api.github.com/users/tigera/following{/other_user}","gists_url":"https://api.github.com/users/tigera/gists{/gist_id}","starred_url":"https://api.github.com/users/tigera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigera/subscriptions","organizations_url":"https://api.github.com/users/tigera/orgs","repos_url":"https://api.github.com/users/tigera/repos","events_url":"https://api.github.com/users/tigera/events{/privacy}","received_events_url":"https://api.github.com/users/tigera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tigera/libcalico-go","description":"Golang Calico library functions:  https://www.projectcalico.org","fork":false,"url":"https://api.github.com/repos/tigera/libcalico-go","forks_url":"https://api.github.com/repos/tigera/libcalico-go/forks","keys_url":"https://api.github.com/repos/tigera/libcalico-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tigera/libcalico-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tigera/libcalico-go/teams","hooks_url":"https://api.github.com/repos/tigera/libcalico-go/hooks","issue_events_url":"https://api.github.com/repos/tigera/libcalico-go/issues/events{/number}","events_url":"https://api.github.com/repos/tigera/libcalico-go/events","assignees_url":"https://api.github.com/repos/tigera/libcalico-go/assignees{/user}","branches_url":"https://api.github.com/repos/tigera/libcalico-go/branches{/branch}","tags_url":"https://api.github.com/repos/tigera/libcalico-go/tags","blobs_url":"https://api.github.com/repos/tigera/libcalico-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tigera/libcalico-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tigera/libcalico-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/tigera/libcalico-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tigera/libcalico-go/statuses/{sha}","languages_url":"https://api.github.com/repos/tigera/libcalico-go/languages","stargazers_url":"https://api.github.com/repos/tigera/libcalico-go/stargazers","contributors_url":"https://api.github.com/repos/tigera/libcalico-go/contributors","subscribers_url":"https://api.github.com/repos/tigera/libcalico-go/subscribers","subscription_url":"https://api.github.com/repos/tigera/libcalico-go/subscription","commits_url":"https://api.github.com/repos/tigera/libcalico-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/tigera/libcalico-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/tigera/libcalico-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/tigera/libcalico-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/tigera/libcalico-go/contents/{+path}","compare_url":"https://api.github.com/repos/tigera/libcalico-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tigera/libcalico-go/merges","archive_url":"https://api.github.com/repos/tigera/libcalico-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tigera/libcalico-go/downloads","issues_url":"https://api.github.com/repos/tigera/libcalico-go/issues{/number}","pulls_url":"https://api.github.com/repos/tigera/libcalico-go/pulls{/number}","milestones_url":"https://api.github.com/repos/tigera/libcalico-go/milestones{/number}","notifications_url":"https://api.github.com/repos/tigera/libcalico-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tigera/libcalico-go/labels{/name}","releases_url":"https://api.github.com/repos/tigera/libcalico-go/releases{/id}","deployments_url":"https://api.github.com/repos/tigera/libcalico-go/deployments","created_at":"2016-07-15T17:09:40Z","updated_at":"2016-09-18T07:53:49Z","pushed_at":"2016-09-27T22:11:51Z","git_url":"git://github.com/tigera/libcalico-go.git","ssh_url":"git@github.com:tigera/libcalico-go.git","clone_url":"https://github.com/tigera/libcalico-go.git","svn_url":"https://github.com/tigera/libcalico-go","homepage":null,"size":19554,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":45,"forks":11,"open_issues":45,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/143"},"html":{"href":"https://github.com/tigera/libcalico-go/pull/143"},"issue":{"href":"https://api.github.com/repos/tigera/libcalico-go/issues/143"},"comments":{"href":"https://api.github.com/repos/tigera/libcalico-go/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tigera/libcalico-go/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/tigera/libcalico-go/statuses/f9de92563bf5edccbb9d5723f5a599db6d78fcd7"}}}}
{"actor":{"display_login":"gunjan5"}}