{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/81321735","pull_request_review_id":2309827,"id":81321735,"diff_hunk":"@@ -0,0 +1,86 @@\n+package docker\n+\n+import (\n+\t\"fmt\"\n+\t\"io\"\n+\t\"time\"\n+\n+\t\"github.com/spf13/cobra\"\n+\n+\tkcmdutil \"k8s.io/kubernetes/pkg/kubectl/cmd/util\"\n+\n+\t\"github.com/openshift/origin/pkg/bootstrap/docker/dockerhelper\"\n+\t\"github.com/openshift/origin/pkg/bootstrap/docker/errors\"\n+\t\"github.com/openshift/origin/pkg/cmd/util/clientcmd\"\n+)\n+\n+const (\n+\t// CmdStatusRecommendedName is the recommended command name\n+\tCmdStatusRecommendedName = \"status\"\n+\n+\tcmdStatusLong = `\n+Show the status of the local OpenShift cluster.\n+\n+If you started your OpenShift with a specific docker-machine, you need to specify the\n+same machine using the --docker-machine argument.\n+`\n+\tcmdStatusExample = `\n+\t# See status of local OpenShift cluster\n+  %[1]s\n+\n+  # See status of OpenShift cluster running on Docker machine 'mymachine'\n+  %[1]s --docker-machine=mymachine\n+`\n+)\n+\n+// NewCmdStatus implements the OpenShift cluster status command.\n+func NewCmdStatus(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {\n+\tconfig := &ClientStatusConfig{}\n+\tcmd := &cobra.Command{\n+\t\tUse:     name,\n+\t\tShort:   \"Show OpenShift on Docker status\",\n+\t\tLong:    cmdStatusLong,\n+\t\tExample: fmt.Sprintf(cmdStatusExample, fullName),\n+\t\tRun: func(c *cobra.Command, args []string) {\n+\t\t\tkcmdutil.CheckErr(config.Status(f, out))\n+\t\t},\n+\t}\n+\tcmd.Flags().StringVar(&config.DockerMachine, \"docker-machine\", \"\", \"Specify the Docker machine to use\")\n+\treturn cmd\n+}\n+\n+// ClientStatusConfig is the configuration for the client status command\n+type ClientStatusConfig struct {\n+\tDockerMachine string\n+}\n+\n+// Status prints the developer cluster status\n+func (c *ClientStatusConfig) Status(f *clientcmd.Factory, out io.Writer) error {\n+\tdockerClient, _, err := getDockerClient(out, c.DockerMachine, false)\n+\tif err != nil {\n+\t\treturn errors.ErrNoDockerClient(err)\n+\t}\n+\thelper := dockerhelper.NewHelper(dockerClient, nil)\n+\n+\t_, running, err := helper.GetContainerState(openShiftContainer)\n+\tif err != nil {\n+\t\treturn errors.NewError(\"cannot get state of OpenShift container %s\", openShiftContainer).WithCause(err)\n+\t}\n+\n+\tif running {\n+\t\tclient, _, err := f.Clients()\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tvar statusCode int\n+\t\tclient.Client.Timeout = 10 * time.Second\n+\t\tclient.Get().AbsPath(\"/healthz\").Do().StatusCode(&statusCode)\n+\t\tif statusCode == 200 {\n+\t\t\tfmt.Fprintf(out, \"success: OpenShift container is running\\n\")\n+\t\t\treturn nil\n+\t\t}\n+\t}\n+\n+\treturn errors.NewError(\"OpenShift cluster is not running\")","path":"pkg/bootstrap/docker/status.go","position":85,"original_position":85,"commit_id":"1bcc60378b969c64fbe9729ae0f1bcecf77d0f1e","original_commit_id":"1bcc60378b969c64fbe9729ae0f1bcecf77d0f1e","user":{"login":"php-coder","id":87088,"avatar_url":"https://avatars.githubusercontent.com/u/87088?v=3","gravatar_id":"","url":"https://api.github.com/users/php-coder","html_url":"https://github.com/php-coder","followers_url":"https://api.github.com/users/php-coder/followers","following_url":"https://api.github.com/users/php-coder/following{/other_user}","gists_url":"https://api.github.com/users/php-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/php-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-coder/subscriptions","organizations_url":"https://api.github.com/users/php-coder/orgs","repos_url":"https://api.github.com/users/php-coder/repos","events_url":"https://api.github.com/users/php-coder/events{/privacy}","received_events_url":"https://api.github.com/users/php-coder/received_events","type":"User","site_admin":false},"body":"It looks inconsistent that in case of success we're printing \"container is running\" and otherwise we're printing \"cluster is not running\". Let's use \"cluster\" in the success message too.","created_at":"2016-09-30T11:27:22Z","updated_at":"2016-09-30T11:32:00Z","html_url":"https://github.com/openshift/origin/pull/11171#discussion_r81321735","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/11171","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/81321735"},"html":{"href":"https://github.com/openshift/origin/pull/11171#discussion_r81321735"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/11171"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/11171","id":87476149,"html_url":"https://github.com/openshift/origin/pull/11171","diff_url":"https://github.com/openshift/origin/pull/11171.diff","patch_url":"https://github.com/openshift/origin/pull/11171.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/11171","number":11171,"state":"open","locked":false,"title":"Implement cluster status command, fixes #9935","user":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-30T11:18:03Z","updated_at":"2016-09-30T11:32:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ff0217f4bf1b5f037bca64fa20deec2371d170a","assignee":{"login":"csrwng","id":5834976,"avatar_url":"https://avatars.githubusercontent.com/u/5834976?v=3","gravatar_id":"","url":"https://api.github.com/users/csrwng","html_url":"https://github.com/csrwng","followers_url":"https://api.github.com/users/csrwng/followers","following_url":"https://api.github.com/users/csrwng/following{/other_user}","gists_url":"https://api.github.com/users/csrwng/gists{/gist_id}","starred_url":"https://api.github.com/users/csrwng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csrwng/subscriptions","organizations_url":"https://api.github.com/users/csrwng/orgs","repos_url":"https://api.github.com/users/csrwng/repos","events_url":"https://api.github.com/users/csrwng/events{/privacy}","received_events_url":"https://api.github.com/users/csrwng/received_events","type":"User","site_admin":false},"assignees":[{"login":"csrwng","id":5834976,"avatar_url":"https://avatars.githubusercontent.com/u/5834976?v=3","gravatar_id":"","url":"https://api.github.com/users/csrwng","html_url":"https://github.com/csrwng","followers_url":"https://api.github.com/users/csrwng/followers","following_url":"https://api.github.com/users/csrwng/following{/other_user}","gists_url":"https://api.github.com/users/csrwng/gists{/gist_id}","starred_url":"https://api.github.com/users/csrwng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csrwng/subscriptions","organizations_url":"https://api.github.com/users/csrwng/orgs","repos_url":"https://api.github.com/users/csrwng/repos","events_url":"https://api.github.com/users/csrwng/events{/privacy}","received_events_url":"https://api.github.com/users/csrwng/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/11171/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/11171/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/11171/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/1bcc60378b969c64fbe9729ae0f1bcecf77d0f1e","head":{"label":"jim-minter:issue9935","ref":"issue9935","sha":"1bcc60378b969c64fbe9729ae0f1bcecf77d0f1e","user":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"repo":{"id":63237830,"name":"origin","full_name":"jim-minter/origin","owner":{"login":"jim-minter","id":1038301,"avatar_url":"https://avatars.githubusercontent.com/u/1038301?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jim-minter/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":true,"url":"https://api.github.com/repos/jim-minter/origin","forks_url":"https://api.github.com/repos/jim-minter/origin/forks","keys_url":"https://api.github.com/repos/jim-minter/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jim-minter/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jim-minter/origin/teams","hooks_url":"https://api.github.com/repos/jim-minter/origin/hooks","issue_events_url":"https://api.github.com/repos/jim-minter/origin/issues/events{/number}","events_url":"https://api.github.com/repos/jim-minter/origin/events","assignees_url":"https://api.github.com/repos/jim-minter/origin/assignees{/user}","branches_url":"https://api.github.com/repos/jim-minter/origin/branches{/branch}","tags_url":"https://api.github.com/repos/jim-minter/origin/tags","blobs_url":"https://api.github.com/repos/jim-minter/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jim-minter/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jim-minter/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jim-minter/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jim-minter/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/jim-minter/origin/languages","stargazers_url":"https://api.github.com/repos/jim-minter/origin/stargazers","contributors_url":"https://api.github.com/repos/jim-minter/origin/contributors","subscribers_url":"https://api.github.com/repos/jim-minter/origin/subscribers","subscription_url":"https://api.github.com/repos/jim-minter/origin/subscription","commits_url":"https://api.github.com/repos/jim-minter/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jim-minter/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jim-minter/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jim-minter/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jim-minter/origin/contents/{+path}","compare_url":"https://api.github.com/repos/jim-minter/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jim-minter/origin/merges","archive_url":"https://api.github.com/repos/jim-minter/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jim-minter/origin/downloads","issues_url":"https://api.github.com/repos/jim-minter/origin/issues{/number}","pulls_url":"https://api.github.com/repos/jim-minter/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/jim-minter/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/jim-minter/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jim-minter/origin/labels{/name}","releases_url":"https://api.github.com/repos/jim-minter/origin/releases{/id}","deployments_url":"https://api.github.com/repos/jim-minter/origin/deployments","created_at":"2016-07-13T10:39:40Z","updated_at":"2016-07-13T10:39:49Z","pushed_at":"2016-09-30T11:16:51Z","git_url":"git://github.com/jim-minter/origin.git","ssh_url":"git@github.com:jim-minter/origin.git","clone_url":"https://github.com/jim-minter/origin.git","svn_url":"https://github.com/jim-minter/origin","homepage":"http://www.openshift.org","size":341768,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openshift:master","ref":"master","sha":"b6ba8ec54fec9d607e2264a82c2b1396516a01c0","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-09-30T10:37:16Z","pushed_at":"2016-09-30T11:28:13Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":593677,"stargazers_count":1787,"watchers_count":1787,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1165,"mirror_url":null,"open_issues_count":1198,"forks":1165,"open_issues":1198,"watchers":1787,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/11171"},"html":{"href":"https://github.com/openshift/origin/pull/11171"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/11171"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/11171/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/11171/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/11171/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/1bcc60378b969c64fbe9729ae0f1bcecf77d0f1e"}}}}
{"actor":{"display_login":"php-coder"}}