{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/comments/208654700","pull_request_review_id":144507890,"id":208654700,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODY1NDcwMA==","diff_hunk":"@@ -0,0 +1,106 @@\n+/*\n+Copyright 2018 The Skaffold Authors\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+\n+package config\n+\n+import (\n+\t\"bufio\"\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"strings\"\n+\n+\t\"github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/kubectl\"\n+\n+\thomedir \"github.com/mitchellh/go-homedir\"\n+\t\"github.com/pkg/errors\"\n+\t\"github.com/sirupsen/logrus\"\n+\tyaml \"gopkg.in/yaml.v2\"\n+)\n+\n+func resolveKubectlContext() {\n+\tif kubectx != \"\" {\n+\t\treturn\n+\t}\n+\tvar buf bytes.Buffer\n+\tw := bufio.NewWriter(&buf)\n+\tk := kubectl.CLI{}\n+\n+\tif err := k.Run(nil, w, \"config\", nil, \"current-context\"); err != nil {","path":"cmd/skaffold/app/cmd/config/util.go","position":44,"original_position":44,"commit_id":"1ae6092fa4714e346aa3c27bc3b5b43fa8dfee5f","original_commit_id":"1ae6092fa4714e346aa3c27bc3b5b43fa8dfee5f","user":{"login":"r2d4","id":896032,"node_id":"MDQ6VXNlcjg5NjAzMg==","avatar_url":"https://avatars1.githubusercontent.com/u/896032?v=4","gravatar_id":"","url":"https://api.github.com/users/r2d4","html_url":"https://github.com/r2d4","followers_url":"https://api.github.com/users/r2d4/followers","following_url":"https://api.github.com/users/r2d4/following{/other_user}","gists_url":"https://api.github.com/users/r2d4/gists{/gist_id}","starred_url":"https://api.github.com/users/r2d4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r2d4/subscriptions","organizations_url":"https://api.github.com/users/r2d4/orgs","repos_url":"https://api.github.com/users/r2d4/repos","events_url":"https://api.github.com/users/r2d4/events{/privacy}","received_events_url":"https://api.github.com/users/r2d4/received_events","type":"User","site_admin":false},"body":"https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/kubernetes/context/context.go","created_at":"2018-08-08T16:46:33Z","updated_at":"2018-08-08T16:46:58Z","html_url":"https://github.com/GoogleContainerTools/skaffold/pull/886#discussion_r208654700","pull_request_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/comments/208654700"},"html":{"href":"https://github.com/GoogleContainerTools/skaffold/pull/886#discussion_r208654700"},"pull_request":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886"}},"in_reply_to_id":208653948},"pull_request":{"url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886","id":206857211,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2ODU3MjEx","html_url":"https://github.com/GoogleContainerTools/skaffold/pull/886","diff_url":"https://github.com/GoogleContainerTools/skaffold/pull/886.diff","patch_url":"https://github.com/GoogleContainerTools/skaffold/pull/886.patch","issue_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/886","number":886,"state":"open","locked":false,"title":"Add global skaffold config with list/set commands","user":{"login":"nkubala","id":5531168,"node_id":"MDQ6VXNlcjU1MzExNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"body":"This change adds support for a skaffold properties file, which provides users with an easy way to set both global and context-specific parameters. This will be useful as a way to do context-specific skaffold.yaml templating, as well as repository introspection in the future\r\n\r\nValues in the config will be set on a per-kubectx basis, so different groups of values can be set depending on the remote context the host is pointed to. Skaffold will attempt to use `kubectl` to determine the current context; if this fails, it will fall back to `default`. This can be configured through the `--kubectx (-k)` flag.\r\n\r\nThe default location of the skaffold config will be `~/.skaffold/config`, though this can be configured through the `--config (-c)` flag.\r\n\r\nThis change adds the `default-repo` config field as a first field, though this field is not currently used. More fields can (and will) be added later to the global `Config` struct.\r\n\r\nExample config file:\r\n```yaml\r\n- context: default\r\n  values:\r\n    default-repo: gcr.io/staging-project\r\n- context: gke_production-project_us-west1-a_production\r\n  values:\r\n    default-repo: gcr.io/production-project\r\n```","created_at":"2018-08-07T23:52:18Z","updated_at":"2018-08-08T16:46:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33f11a54ce4b3d2b15d4aeb363ecf61f9c7cd97a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dgageot","id":153495,"node_id":"MDQ6VXNlcjE1MzQ5NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/153495?v=4","gravatar_id":"","url":"https://api.github.com/users/dgageot","html_url":"https://github.com/dgageot","followers_url":"https://api.github.com/users/dgageot/followers","following_url":"https://api.github.com/users/dgageot/following{/other_user}","gists_url":"https://api.github.com/users/dgageot/gists{/gist_id}","starred_url":"https://api.github.com/users/dgageot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgageot/subscriptions","organizations_url":"https://api.github.com/users/dgageot/orgs","repos_url":"https://api.github.com/users/dgageot/repos","events_url":"https://api.github.com/users/dgageot/events{/privacy}","received_events_url":"https://api.github.com/users/dgageot/received_events","type":"User","site_admin":false},{"login":"balopat","id":635073,"node_id":"MDQ6VXNlcjYzNTA3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/635073?v=4","gravatar_id":"","url":"https://api.github.com/users/balopat","html_url":"https://github.com/balopat","followers_url":"https://api.github.com/users/balopat/followers","following_url":"https://api.github.com/users/balopat/following{/other_user}","gists_url":"https://api.github.com/users/balopat/gists{/gist_id}","starred_url":"https://api.github.com/users/balopat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balopat/subscriptions","organizations_url":"https://api.github.com/users/balopat/orgs","repos_url":"https://api.github.com/users/balopat/repos","events_url":"https://api.github.com/users/balopat/events{/privacy}","received_events_url":"https://api.github.com/users/balopat/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886/commits","review_comments_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886/comments","review_comment_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/886/comments","statuses_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/statuses/1ae6092fa4714e346aa3c27bc3b5b43fa8dfee5f","head":{"label":"nkubala:global_config","ref":"global_config","sha":"1ae6092fa4714e346aa3c27bc3b5b43fa8dfee5f","user":{"login":"nkubala","id":5531168,"node_id":"MDQ6VXNlcjU1MzExNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"repo":{"id":126401394,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY0MDEzOTQ=","name":"skaffold","full_name":"nkubala/skaffold","owner":{"login":"nkubala","id":5531168,"node_id":"MDQ6VXNlcjU1MzExNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5531168?v=4","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nkubala/skaffold","description":"Easy and Repeatable Kubernetes Development","fork":true,"url":"https://api.github.com/repos/nkubala/skaffold","forks_url":"https://api.github.com/repos/nkubala/skaffold/forks","keys_url":"https://api.github.com/repos/nkubala/skaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkubala/skaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkubala/skaffold/teams","hooks_url":"https://api.github.com/repos/nkubala/skaffold/hooks","issue_events_url":"https://api.github.com/repos/nkubala/skaffold/issues/events{/number}","events_url":"https://api.github.com/repos/nkubala/skaffold/events","assignees_url":"https://api.github.com/repos/nkubala/skaffold/assignees{/user}","branches_url":"https://api.github.com/repos/nkubala/skaffold/branches{/branch}","tags_url":"https://api.github.com/repos/nkubala/skaffold/tags","blobs_url":"https://api.github.com/repos/nkubala/skaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkubala/skaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkubala/skaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkubala/skaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkubala/skaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/nkubala/skaffold/languages","stargazers_url":"https://api.github.com/repos/nkubala/skaffold/stargazers","contributors_url":"https://api.github.com/repos/nkubala/skaffold/contributors","subscribers_url":"https://api.github.com/repos/nkubala/skaffold/subscribers","subscription_url":"https://api.github.com/repos/nkubala/skaffold/subscription","commits_url":"https://api.github.com/repos/nkubala/skaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkubala/skaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkubala/skaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkubala/skaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkubala/skaffold/contents/{+path}","compare_url":"https://api.github.com/repos/nkubala/skaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkubala/skaffold/merges","archive_url":"https://api.github.com/repos/nkubala/skaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkubala/skaffold/downloads","issues_url":"https://api.github.com/repos/nkubala/skaffold/issues{/number}","pulls_url":"https://api.github.com/repos/nkubala/skaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/nkubala/skaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/nkubala/skaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkubala/skaffold/labels{/name}","releases_url":"https://api.github.com/repos/nkubala/skaffold/releases{/id}","deployments_url":"https://api.github.com/repos/nkubala/skaffold/deployments","created_at":"2018-03-22T22:17:08Z","updated_at":"2018-08-07T23:17:31Z","pushed_at":"2018-08-07T23:52:08Z","git_url":"git://github.com/nkubala/skaffold.git","ssh_url":"git@github.com:nkubala/skaffold.git","clone_url":"https://github.com/nkubala/skaffold.git","svn_url":"https://github.com/nkubala/skaffold","homepage":"","size":20238,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleContainerTools:master","ref":"master","sha":"9e7b7d207e8e4e6f894ad7da3dc8f4d7ef62f149","user":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"repo":{"id":118654121,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg2NTQxMjE=","name":"skaffold","full_name":"GoogleContainerTools/skaffold","owner":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleContainerTools/skaffold","description":"Easy and Repeatable Kubernetes Development","fork":false,"url":"https://api.github.com/repos/GoogleContainerTools/skaffold","forks_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/forks","keys_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/teams","hooks_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/hooks","issue_events_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/events","assignees_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/tags","blobs_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/languages","stargazers_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/stargazers","contributors_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/contributors","subscribers_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/subscribers","subscription_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/subscription","commits_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/merges","archive_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/downloads","issues_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/labels{/name}","releases_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleContainerTools/skaffold/deployments","created_at":"2018-01-23T18:51:29Z","updated_at":"2018-08-08T13:52:37Z","pushed_at":"2018-08-08T08:01:07Z","git_url":"git://github.com/GoogleContainerTools/skaffold.git","ssh_url":"git@github.com:GoogleContainerTools/skaffold.git","clone_url":"https://github.com/GoogleContainerTools/skaffold.git","svn_url":"https://github.com/GoogleContainerTools/skaffold","homepage":"","size":37718,"stargazers_count":4451,"watchers_count":4451,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":227,"mirror_url":null,"archived":false,"open_issues_count":118,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":227,"open_issues":118,"watchers":4451,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886"},"html":{"href":"https://github.com/GoogleContainerTools/skaffold/pull/886"},"issue":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/886"},"comments":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/issues/886/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/pulls/886/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleContainerTools/skaffold/statuses/1ae6092fa4714e346aa3c27bc3b5b43fa8dfee5f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"r2d4"}}