{"action":"created","comment":{"url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/comments/202998406","pull_request_review_id":137800308,"id":202998406,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjk5ODQwNg==","diff_hunk":"@@ -1,58 +1,59 @@\n package cmd\n \n import (\n-\t\"github.com/spf13/cobra\"\n \tlog \"github.com/sirupsen/logrus\"\n+\t\"github.com/spf13/cobra\"\n \n \t\"github.com/cmoulliard/k8s-supervisor/pkg/common/oc\"\n \n \t\"github.com/cmoulliard/k8s-supervisor/pkg/buildpack\"\n )\n \n var initCmd = &cobra.Command{\n-\tUse:   \"init [flags]\",\n-\tShort: \"Create a development's pod for the component\",\n-\tLong:  `Create a development's pod for the component.`,\n+\tUse:     \"init [flags]\",\n+\tShort:   \"Create a development's pod for the component\",\n+\tLong:    `Create a development's pod for the component.`,\n \tExample: ` sb init -n bootapp`,\n-\tArgs: cobra.RangeArgs(0, 1),\n+\tArgs:    cobra.RangeArgs(0, 1),\n \tRun: func(cmd *cobra.Command, args []string) {\n \n \t\tlog.Info(\"Init command called\")\n-\t\tlog.Debug(\"Namespace : \", namespace)\n+\t\tlog.Debugf(\"Namespace: %s\", namespace)\n \n-\t\t// Parse MANIFEST - Step 1\n+\t\t// Parse MANIFEST\n \t\tapplication := parseManifest()\n \n-\t\t// Add Namespace's value\n-\t\tapplication.Namespace = namespace\n-\n-\t\t// Get K8s' config file - Step 2\n+\t\t// Get K8s' config file\n \t\tkubeCfg := getK8Config(*cmd)\n \n-\t\t// Execute oc command to switch to the namespace defined\n-\t\tlog.Info(\"[Step 3] - Get k8s default's namespace\")\n-\t\toc.ExecCommand(oc.Command{Args: []string{\"project\",application.Namespace}})\n+\t\t// Switch to namespace if specified or retrieve the current one if not\n+\t\tcurrentNs, err := oc.ExecCommand(oc.Command{Args: []string{\"project\", \"-q\", namespace}})\n+\t\tif err != nil {\n+\t\t\tlog.Fatal(err)\n+\t\t}\n+\t\tlog.Infof(\"Using '%s' namespace\", currentNs)\n+\t\tapplication.Namespace = currentNs\n \n-\t\t// Create Kube Rest's Config Client - Step 3","path":"cmd/init.go","position":51,"original_position":51,"commit_id":"6508a9709482e9721407b9d1fab1792361540cc2","original_commit_id":"6508a9709482e9721407b9d1fab1792361540cc2","user":{"login":"cmoulliard","id":463790,"node_id":"MDQ6VXNlcjQ2Mzc5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/463790?v=4","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"body":"That could be hard to maintain as that will evolve over the time. I will merge the PR then","created_at":"2018-07-17T12:20:18Z","updated_at":"2018-07-17T12:20:18Z","html_url":"https://github.com/cmoulliard/k8s-supervisor/pull/4#discussion_r202998406","pull_request_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/comments/202998406"},"html":{"href":"https://github.com/cmoulliard/k8s-supervisor/pull/4#discussion_r202998406"},"pull_request":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4"}},"in_reply_to_id":202982498},"pull_request":{"url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4","id":201899175,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxODk5MTc1","html_url":"https://github.com/cmoulliard/k8s-supervisor/pull/4","diff_url":"https://github.com/cmoulliard/k8s-supervisor/pull/4.diff","patch_url":"https://github.com/cmoulliard/k8s-supervisor/pull/4.patch","issue_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/4","number":4,"state":"open","locked":false,"title":"Make init work without a MANIFEST. ","user":{"login":"metacosm","id":120057,"node_id":"MDQ6VXNlcjEyMDA1Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/120057?v=4","gravatar_id":"","url":"https://api.github.com/users/metacosm","html_url":"https://github.com/metacosm","followers_url":"https://api.github.com/users/metacosm/followers","following_url":"https://api.github.com/users/metacosm/following{/other_user}","gists_url":"https://api.github.com/users/metacosm/gists{/gist_id}","starred_url":"https://api.github.com/users/metacosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metacosm/subscriptions","organizations_url":"https://api.github.com/users/metacosm/orgs","repos_url":"https://api.github.com/users/metacosm/repos","events_url":"https://api.github.com/users/metacosm/events{/privacy}","received_events_url":"https://api.github.com/users/metacosm/received_events","type":"User","site_admin":false},"body":"convention over configuration! :)","created_at":"2018-07-17T10:45:08Z","updated_at":"2018-07-17T12:20:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f27743b1e4e5fc24402d41eb231d9d9554e35996","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4/commits","review_comments_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4/comments","review_comment_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/4/comments","statuses_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/statuses/6508a9709482e9721407b9d1fab1792361540cc2","head":{"label":"metacosm:improve-init","ref":"improve-init","sha":"6508a9709482e9721407b9d1fab1792361540cc2","user":{"login":"metacosm","id":120057,"node_id":"MDQ6VXNlcjEyMDA1Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/120057?v=4","gravatar_id":"","url":"https://api.github.com/users/metacosm","html_url":"https://github.com/metacosm","followers_url":"https://api.github.com/users/metacosm/followers","following_url":"https://api.github.com/users/metacosm/following{/other_user}","gists_url":"https://api.github.com/users/metacosm/gists{/gist_id}","starred_url":"https://api.github.com/users/metacosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metacosm/subscriptions","organizations_url":"https://api.github.com/users/metacosm/orgs","repos_url":"https://api.github.com/users/metacosm/repos","events_url":"https://api.github.com/users/metacosm/events{/privacy}","received_events_url":"https://api.github.com/users/metacosm/received_events","type":"User","site_admin":false},"repo":{"id":140723472,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA3MjM0NzI=","name":"k8s-supervisor","full_name":"metacosm/k8s-supervisor","owner":{"login":"metacosm","id":120057,"node_id":"MDQ6VXNlcjEyMDA1Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/120057?v=4","gravatar_id":"","url":"https://api.github.com/users/metacosm","html_url":"https://github.com/metacosm","followers_url":"https://api.github.com/users/metacosm/followers","following_url":"https://api.github.com/users/metacosm/following{/other_user}","gists_url":"https://api.github.com/users/metacosm/gists{/gist_id}","starred_url":"https://api.github.com/users/metacosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metacosm/subscriptions","organizations_url":"https://api.github.com/users/metacosm/orgs","repos_url":"https://api.github.com/users/metacosm/repos","events_url":"https://api.github.com/users/metacosm/events{/privacy}","received_events_url":"https://api.github.com/users/metacosm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/metacosm/k8s-supervisor","description":null,"fork":true,"url":"https://api.github.com/repos/metacosm/k8s-supervisor","forks_url":"https://api.github.com/repos/metacosm/k8s-supervisor/forks","keys_url":"https://api.github.com/repos/metacosm/k8s-supervisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metacosm/k8s-supervisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metacosm/k8s-supervisor/teams","hooks_url":"https://api.github.com/repos/metacosm/k8s-supervisor/hooks","issue_events_url":"https://api.github.com/repos/metacosm/k8s-supervisor/issues/events{/number}","events_url":"https://api.github.com/repos/metacosm/k8s-supervisor/events","assignees_url":"https://api.github.com/repos/metacosm/k8s-supervisor/assignees{/user}","branches_url":"https://api.github.com/repos/metacosm/k8s-supervisor/branches{/branch}","tags_url":"https://api.github.com/repos/metacosm/k8s-supervisor/tags","blobs_url":"https://api.github.com/repos/metacosm/k8s-supervisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metacosm/k8s-supervisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metacosm/k8s-supervisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/metacosm/k8s-supervisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metacosm/k8s-supervisor/statuses/{sha}","languages_url":"https://api.github.com/repos/metacosm/k8s-supervisor/languages","stargazers_url":"https://api.github.com/repos/metacosm/k8s-supervisor/stargazers","contributors_url":"https://api.github.com/repos/metacosm/k8s-supervisor/contributors","subscribers_url":"https://api.github.com/repos/metacosm/k8s-supervisor/subscribers","subscription_url":"https://api.github.com/repos/metacosm/k8s-supervisor/subscription","commits_url":"https://api.github.com/repos/metacosm/k8s-supervisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/metacosm/k8s-supervisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/metacosm/k8s-supervisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/metacosm/k8s-supervisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/metacosm/k8s-supervisor/contents/{+path}","compare_url":"https://api.github.com/repos/metacosm/k8s-supervisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metacosm/k8s-supervisor/merges","archive_url":"https://api.github.com/repos/metacosm/k8s-supervisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metacosm/k8s-supervisor/downloads","issues_url":"https://api.github.com/repos/metacosm/k8s-supervisor/issues{/number}","pulls_url":"https://api.github.com/repos/metacosm/k8s-supervisor/pulls{/number}","milestones_url":"https://api.github.com/repos/metacosm/k8s-supervisor/milestones{/number}","notifications_url":"https://api.github.com/repos/metacosm/k8s-supervisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metacosm/k8s-supervisor/labels{/name}","releases_url":"https://api.github.com/repos/metacosm/k8s-supervisor/releases{/id}","deployments_url":"https://api.github.com/repos/metacosm/k8s-supervisor/deployments","created_at":"2018-07-12T14:21:22Z","updated_at":"2018-07-12T14:21:24Z","pushed_at":"2018-07-17T10:43:31Z","git_url":"git://github.com/metacosm/k8s-supervisor.git","ssh_url":"git@github.com:metacosm/k8s-supervisor.git","clone_url":"https://github.com/metacosm/k8s-supervisor.git","svn_url":"https://github.com/metacosm/k8s-supervisor","homepage":null,"size":30538,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cmoulliard:master","ref":"master","sha":"bc940420270bbc17969b0e012bb20e49f42e1d2b","user":{"login":"cmoulliard","id":463790,"node_id":"MDQ6VXNlcjQ2Mzc5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/463790?v=4","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"repo":{"id":138866227,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg4NjYyMjc=","name":"k8s-supervisor","full_name":"cmoulliard/k8s-supervisor","owner":{"login":"cmoulliard","id":463790,"node_id":"MDQ6VXNlcjQ2Mzc5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/463790?v=4","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmoulliard/k8s-supervisor","description":null,"fork":false,"url":"https://api.github.com/repos/cmoulliard/k8s-supervisor","forks_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/forks","keys_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/teams","hooks_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/hooks","issue_events_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/events{/number}","events_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/events","assignees_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/assignees{/user}","branches_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/branches{/branch}","tags_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/tags","blobs_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/statuses/{sha}","languages_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/languages","stargazers_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/stargazers","contributors_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/contributors","subscribers_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/subscribers","subscription_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/subscription","commits_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/contents/{+path}","compare_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/merges","archive_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/downloads","issues_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues{/number}","pulls_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls{/number}","milestones_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/milestones{/number}","notifications_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/labels{/name}","releases_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/releases{/id}","deployments_url":"https://api.github.com/repos/cmoulliard/k8s-supervisor/deployments","created_at":"2018-06-27T10:24:35Z","updated_at":"2018-07-17T07:06:21Z","pushed_at":"2018-07-17T10:45:09Z","git_url":"git://github.com/cmoulliard/k8s-supervisor.git","ssh_url":"git@github.com:cmoulliard/k8s-supervisor.git","clone_url":"https://github.com/cmoulliard/k8s-supervisor.git","svn_url":"https://github.com/cmoulliard/k8s-supervisor","homepage":null,"size":30544,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4"},"html":{"href":"https://github.com/cmoulliard/k8s-supervisor/pull/4"},"issue":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/4"},"comments":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/cmoulliard/k8s-supervisor/statuses/6508a9709482e9721407b9d1fab1792361540cc2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cmoulliard"}}