{"action":"created","comment":{"url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/comments/143265082","pull_request_review_id":67752479,"id":143265082,"diff_hunk":"@@ -279,24 +276,38 @@ func (m *manager) SetEnvironment(name string, desired *Environment) error {\n \t\tname = desired.Name\n \t}\n \n-\t// Update fields in spec.json\n+\t//\n+\t// Update fields in spec.json.\n+\t//\n+\n+\tvar URI string\n \tif len(desired.URI) != 0 {\n \t\tlog.Infof(\"Setting environment URI to '%s'\", desired.URI)\n+\t\tURI = desired.URI\n+\t} else {\n+\t\tURI = env.URI\n+\t}\n+\tvar namespace string\n+\tif len(desired.Namespace) != 0 {\n+\t\tlog.Infof(\"Setting environment namespace to '%s'\", desired.Namespace)\n+\t\tnamespace = desired.Namespace\n+\t} else {\n+\t\tnamespace = env.Namespace\n+\t}","path":"metadata/environment.go","position":101,"original_position":101,"commit_id":"76e24ec9466bf72c8e0dfcd4b9e4c901dac07399","original_commit_id":"76e24ec9466bf72c8e0dfcd4b9e4c901dac07399","user":{"login":"hausdorff","id":1409156,"avatar_url":"https://avatars1.githubusercontent.com/u/1409156?v=4","gravatar_id":"","url":"https://api.github.com/users/hausdorff","html_url":"https://github.com/hausdorff","followers_url":"https://api.github.com/users/hausdorff/followers","following_url":"https://api.github.com/users/hausdorff/following{/other_user}","gists_url":"https://api.github.com/users/hausdorff/gists{/gist_id}","starred_url":"https://api.github.com/users/hausdorff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hausdorff/subscriptions","organizations_url":"https://api.github.com/users/hausdorff/orgs","repos_url":"https://api.github.com/users/hausdorff/repos","events_url":"https://api.github.com/users/hausdorff/events{/privacy}","received_events_url":"https://api.github.com/users/hausdorff/received_events","type":"User","site_admin":false},"body":"I notice that we do the length == 0 check twice. I think if we do settle on checking it, it should be here, so it's consistent across all call sites, rather than in the command?","created_at":"2017-10-06T18:32:38Z","updated_at":"2017-10-06T18:37:38Z","html_url":"https://github.com/ksonnet/kubecfg/pull/161#discussion_r143265082","pull_request_url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/comments/143265082"},"html":{"href":"https://github.com/ksonnet/kubecfg/pull/161#discussion_r143265082"},"pull_request":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161","id":143277794,"html_url":"https://github.com/ksonnet/kubecfg/pull/161","diff_url":"https://github.com/ksonnet/kubecfg/pull/161.diff","patch_url":"https://github.com/ksonnet/kubecfg/pull/161.patch","issue_url":"https://api.github.com/repos/ksonnet/kubecfg/issues/161","number":161,"state":"open","locked":false,"title":"Introduce namespace to environments","user":{"login":"jessicayuen","id":3442374,"avatar_url":"https://avatars0.githubusercontent.com/u/3442374?v=4","gravatar_id":"","url":"https://api.github.com/users/jessicayuen","html_url":"https://github.com/jessicayuen","followers_url":"https://api.github.com/users/jessicayuen/followers","following_url":"https://api.github.com/users/jessicayuen/following{/other_user}","gists_url":"https://api.github.com/users/jessicayuen/gists{/gist_id}","starred_url":"https://api.github.com/users/jessicayuen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessicayuen/subscriptions","organizations_url":"https://api.github.com/users/jessicayuen/orgs","repos_url":"https://api.github.com/users/jessicayuen/repos","events_url":"https://api.github.com/users/jessicayuen/events{/privacy}","received_events_url":"https://api.github.com/users/jessicayuen/received_events","type":"User","site_admin":false},"body":"Environments currently have the concept of a server URI, but it is\r\nambiguous which cluster namespace to use.\r\n\r\nThis commit will introduce the concept of namespaces to the env\r\ncommands.\r\n\r\nFor example,\r\n`kubecfg env add staging http://mock-staging-uri \\\r\n --namespace=staging-namespace`\r\n`kubecfg env set staging --namespace=staging-namespace`\r\n\r\nThe default environment will use the namespace of the default context.\r\n\r\nThis commit will also update commands that take the <env> arg such as\r\n`apply` to make use of the env namespace, if specified.\r\n\r\nFixes #148 ","created_at":"2017-09-27T01:15:45Z","updated_at":"2017-10-06T18:37:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"904e21fbfc83195f25c8ef8fecfbfa05b868ab81","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161/commits","review_comments_url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161/comments","review_comment_url":"https://api.github.com/repos/ksonnet/kubecfg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ksonnet/kubecfg/issues/161/comments","statuses_url":"https://api.github.com/repos/ksonnet/kubecfg/statuses/76e24ec9466bf72c8e0dfcd4b9e4c901dac07399","head":{"label":"jessicayuen:env-namespaces","ref":"env-namespaces","sha":"76e24ec9466bf72c8e0dfcd4b9e4c901dac07399","user":{"login":"jessicayuen","id":3442374,"avatar_url":"https://avatars0.githubusercontent.com/u/3442374?v=4","gravatar_id":"","url":"https://api.github.com/users/jessicayuen","html_url":"https://github.com/jessicayuen","followers_url":"https://api.github.com/users/jessicayuen/followers","following_url":"https://api.github.com/users/jessicayuen/following{/other_user}","gists_url":"https://api.github.com/users/jessicayuen/gists{/gist_id}","starred_url":"https://api.github.com/users/jessicayuen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessicayuen/subscriptions","organizations_url":"https://api.github.com/users/jessicayuen/orgs","repos_url":"https://api.github.com/users/jessicayuen/repos","events_url":"https://api.github.com/users/jessicayuen/events{/privacy}","received_events_url":"https://api.github.com/users/jessicayuen/received_events","type":"User","site_admin":false},"repo":{"id":102029601,"name":"kubecfg","full_name":"jessicayuen/kubecfg","owner":{"login":"jessicayuen","id":3442374,"avatar_url":"https://avatars0.githubusercontent.com/u/3442374?v=4","gravatar_id":"","url":"https://api.github.com/users/jessicayuen","html_url":"https://github.com/jessicayuen","followers_url":"https://api.github.com/users/jessicayuen/followers","following_url":"https://api.github.com/users/jessicayuen/following{/other_user}","gists_url":"https://api.github.com/users/jessicayuen/gists{/gist_id}","starred_url":"https://api.github.com/users/jessicayuen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessicayuen/subscriptions","organizations_url":"https://api.github.com/users/jessicayuen/orgs","repos_url":"https://api.github.com/users/jessicayuen/repos","events_url":"https://api.github.com/users/jessicayuen/events{/privacy}","received_events_url":"https://api.github.com/users/jessicayuen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jessicayuen/kubecfg","description":"A tool for managing complex enterprise Kubernetes environments as code.￼","fork":true,"url":"https://api.github.com/repos/jessicayuen/kubecfg","forks_url":"https://api.github.com/repos/jessicayuen/kubecfg/forks","keys_url":"https://api.github.com/repos/jessicayuen/kubecfg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jessicayuen/kubecfg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jessicayuen/kubecfg/teams","hooks_url":"https://api.github.com/repos/jessicayuen/kubecfg/hooks","issue_events_url":"https://api.github.com/repos/jessicayuen/kubecfg/issues/events{/number}","events_url":"https://api.github.com/repos/jessicayuen/kubecfg/events","assignees_url":"https://api.github.com/repos/jessicayuen/kubecfg/assignees{/user}","branches_url":"https://api.github.com/repos/jessicayuen/kubecfg/branches{/branch}","tags_url":"https://api.github.com/repos/jessicayuen/kubecfg/tags","blobs_url":"https://api.github.com/repos/jessicayuen/kubecfg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jessicayuen/kubecfg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jessicayuen/kubecfg/git/refs{/sha}","trees_url":"https://api.github.com/repos/jessicayuen/kubecfg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jessicayuen/kubecfg/statuses/{sha}","languages_url":"https://api.github.com/repos/jessicayuen/kubecfg/languages","stargazers_url":"https://api.github.com/repos/jessicayuen/kubecfg/stargazers","contributors_url":"https://api.github.com/repos/jessicayuen/kubecfg/contributors","subscribers_url":"https://api.github.com/repos/jessicayuen/kubecfg/subscribers","subscription_url":"https://api.github.com/repos/jessicayuen/kubecfg/subscription","commits_url":"https://api.github.com/repos/jessicayuen/kubecfg/commits{/sha}","git_commits_url":"https://api.github.com/repos/jessicayuen/kubecfg/git/commits{/sha}","comments_url":"https://api.github.com/repos/jessicayuen/kubecfg/comments{/number}","issue_comment_url":"https://api.github.com/repos/jessicayuen/kubecfg/issues/comments{/number}","contents_url":"https://api.github.com/repos/jessicayuen/kubecfg/contents/{+path}","compare_url":"https://api.github.com/repos/jessicayuen/kubecfg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jessicayuen/kubecfg/merges","archive_url":"https://api.github.com/repos/jessicayuen/kubecfg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jessicayuen/kubecfg/downloads","issues_url":"https://api.github.com/repos/jessicayuen/kubecfg/issues{/number}","pulls_url":"https://api.github.com/repos/jessicayuen/kubecfg/pulls{/number}","milestones_url":"https://api.github.com/repos/jessicayuen/kubecfg/milestones{/number}","notifications_url":"https://api.github.com/repos/jessicayuen/kubecfg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jessicayuen/kubecfg/labels{/name}","releases_url":"https://api.github.com/repos/jessicayuen/kubecfg/releases{/id}","deployments_url":"https://api.github.com/repos/jessicayuen/kubecfg/deployments","created_at":"2017-08-31T18:01:07Z","updated_at":"2017-08-31T18:01:09Z","pushed_at":"2017-10-06T18:36:38Z","git_url":"git://github.com/jessicayuen/kubecfg.git","ssh_url":"git@github.com:jessicayuen/kubecfg.git","clone_url":"https://github.com/jessicayuen/kubecfg.git","svn_url":"https://github.com/jessicayuen/kubecfg","homepage":"","size":5167,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ksonnet:master","ref":"master","sha":"fa6d1a69c24a6d655b630737b6af79a1eb7c1a8f","user":{"login":"ksonnet","id":28765962,"avatar_url":"https://avatars3.githubusercontent.com/u/28765962?v=4","gravatar_id":"","url":"https://api.github.com/users/ksonnet","html_url":"https://github.com/ksonnet","followers_url":"https://api.github.com/users/ksonnet/followers","following_url":"https://api.github.com/users/ksonnet/following{/other_user}","gists_url":"https://api.github.com/users/ksonnet/gists{/gist_id}","starred_url":"https://api.github.com/users/ksonnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksonnet/subscriptions","organizations_url":"https://api.github.com/users/ksonnet/orgs","repos_url":"https://api.github.com/users/ksonnet/repos","events_url":"https://api.github.com/users/ksonnet/events{/privacy}","received_events_url":"https://api.github.com/users/ksonnet/received_events","type":"Organization","site_admin":false},"repo":{"id":91519321,"name":"kubecfg","full_name":"ksonnet/kubecfg","owner":{"login":"ksonnet","id":28765962,"avatar_url":"https://avatars3.githubusercontent.com/u/28765962?v=4","gravatar_id":"","url":"https://api.github.com/users/ksonnet","html_url":"https://github.com/ksonnet","followers_url":"https://api.github.com/users/ksonnet/followers","following_url":"https://api.github.com/users/ksonnet/following{/other_user}","gists_url":"https://api.github.com/users/ksonnet/gists{/gist_id}","starred_url":"https://api.github.com/users/ksonnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksonnet/subscriptions","organizations_url":"https://api.github.com/users/ksonnet/orgs","repos_url":"https://api.github.com/users/ksonnet/repos","events_url":"https://api.github.com/users/ksonnet/events{/privacy}","received_events_url":"https://api.github.com/users/ksonnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ksonnet/kubecfg","description":"A tool for managing complex enterprise Kubernetes environments as code.￼","fork":false,"url":"https://api.github.com/repos/ksonnet/kubecfg","forks_url":"https://api.github.com/repos/ksonnet/kubecfg/forks","keys_url":"https://api.github.com/repos/ksonnet/kubecfg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ksonnet/kubecfg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ksonnet/kubecfg/teams","hooks_url":"https://api.github.com/repos/ksonnet/kubecfg/hooks","issue_events_url":"https://api.github.com/repos/ksonnet/kubecfg/issues/events{/number}","events_url":"https://api.github.com/repos/ksonnet/kubecfg/events","assignees_url":"https://api.github.com/repos/ksonnet/kubecfg/assignees{/user}","branches_url":"https://api.github.com/repos/ksonnet/kubecfg/branches{/branch}","tags_url":"https://api.github.com/repos/ksonnet/kubecfg/tags","blobs_url":"https://api.github.com/repos/ksonnet/kubecfg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ksonnet/kubecfg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ksonnet/kubecfg/git/refs{/sha}","trees_url":"https://api.github.com/repos/ksonnet/kubecfg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ksonnet/kubecfg/statuses/{sha}","languages_url":"https://api.github.com/repos/ksonnet/kubecfg/languages","stargazers_url":"https://api.github.com/repos/ksonnet/kubecfg/stargazers","contributors_url":"https://api.github.com/repos/ksonnet/kubecfg/contributors","subscribers_url":"https://api.github.com/repos/ksonnet/kubecfg/subscribers","subscription_url":"https://api.github.com/repos/ksonnet/kubecfg/subscription","commits_url":"https://api.github.com/repos/ksonnet/kubecfg/commits{/sha}","git_commits_url":"https://api.github.com/repos/ksonnet/kubecfg/git/commits{/sha}","comments_url":"https://api.github.com/repos/ksonnet/kubecfg/comments{/number}","issue_comment_url":"https://api.github.com/repos/ksonnet/kubecfg/issues/comments{/number}","contents_url":"https://api.github.com/repos/ksonnet/kubecfg/contents/{+path}","compare_url":"https://api.github.com/repos/ksonnet/kubecfg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ksonnet/kubecfg/merges","archive_url":"https://api.github.com/repos/ksonnet/kubecfg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ksonnet/kubecfg/downloads","issues_url":"https://api.github.com/repos/ksonnet/kubecfg/issues{/number}","pulls_url":"https://api.github.com/repos/ksonnet/kubecfg/pulls{/number}","milestones_url":"https://api.github.com/repos/ksonnet/kubecfg/milestones{/number}","notifications_url":"https://api.github.com/repos/ksonnet/kubecfg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ksonnet/kubecfg/labels{/name}","releases_url":"https://api.github.com/repos/ksonnet/kubecfg/releases{/id}","deployments_url":"https://api.github.com/repos/ksonnet/kubecfg/deployments","created_at":"2017-05-17T01:13:48Z","updated_at":"2017-10-05T23:21:47Z","pushed_at":"2017-10-06T18:36:39Z","git_url":"git://github.com/ksonnet/kubecfg.git","ssh_url":"git@github.com:ksonnet/kubecfg.git","clone_url":"https://github.com/ksonnet/kubecfg.git","svn_url":"https://github.com/ksonnet/kubecfg","homepage":"","size":5114,"stargazers_count":147,"watchers_count":147,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":49,"forks":16,"open_issues":49,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161"},"html":{"href":"https://github.com/ksonnet/kubecfg/pull/161"},"issue":{"href":"https://api.github.com/repos/ksonnet/kubecfg/issues/161"},"comments":{"href":"https://api.github.com/repos/ksonnet/kubecfg/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ksonnet/kubecfg/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/ksonnet/kubecfg/statuses/76e24ec9466bf72c8e0dfcd4b9e4c901dac07399"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"hausdorff"}}