{"action":"created","comment":{"url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/comments/80521583","id":80521583,"diff_hunk":"@@ -249,26 +249,43 @@ function extract_spinnaker_gcr_credentials() {\n   mkdir -p $(dirname $config_path)\n   chown -R spinnaker:spinnaker $(dirname $config_path)\n \n+  local gcr_enabled=$(get_instance_metadata_attribute \"gcr_enabled\")\n   local gcr_account=$(get_instance_metadata_attribute \"gcr_account\")\n-  if [ -n \"$gcr_account\" ]; then\n-    # This downloads the JSON key for the specified service account\n+\n+  if [ -n \"$gcr_enabled\" ] || [ -n \"$gcr_account\" ]; then\n+    echo \"GCR enabled\"\n+\n+    if [ -z \"$gcr_account\" ]; then\n+      gcr_account=$(gcloud iam service-accounts list --filter=\"displayName:'Compute Engine default service account'\" --format=\"value(email)\")\n+      clear_instance_metadata \"gcr_account\"\n+    fi\n+\n+    echo \"Extracting GCR credentials for email $gcr_account\"","path":"install/first_google_boot.sh","position":17,"original_position":17,"commit_id":"3eda4d3550e227e7e3d5b2f366228c01c0e4fc5e","original_commit_id":"3eda4d3550e227e7e3d5b2f366228c01c0e4fc5e","user":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"body":"That's fine - above if gcr_account isn't set it will be set to Compute Engine default service account, which exists as long as you have an instance running. ","created_at":"2016-09-26T17:00:28Z","updated_at":"2016-09-26T17:00:28Z","html_url":"https://github.com/spinnaker/spinnaker/pull/1170#discussion_r80521583","pull_request_url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170","_links":{"self":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/comments/80521583"},"html":{"href":"https://github.com/spinnaker/spinnaker/pull/1170#discussion_r80521583"},"pull_request":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170"}}},"pull_request":{"url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170","id":86759794,"html_url":"https://github.com/spinnaker/spinnaker/pull/1170","diff_url":"https://github.com/spinnaker/spinnaker/pull/1170.diff","patch_url":"https://github.com/spinnaker/spinnaker/pull/1170.patch","issue_url":"https://api.github.com/repos/spinnaker/spinnaker/issues/1170","number":1170,"state":"open","locked":false,"title":"(gcr) simplify lookup of service account email","user":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"body":"@ewiseblatt PTAL\r\n\r\nIf the user now provides \"gcr_enabled\" as instance metadata, but does not\r\nsupply an email address, the default compute service account is used.\r\n\r\nAlso the user can optionally provide which GCR registry to use.\r\n\r\nThe next set of changes will allow a user to specify where their kube cluster is.","created_at":"2016-09-26T15:02:34Z","updated_at":"2016-09-26T17:00:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3874787220784df088896e016373425bfde8383f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170/commits","review_comments_url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170/comments","review_comment_url":"https://api.github.com/repos/spinnaker/spinnaker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spinnaker/spinnaker/issues/1170/comments","statuses_url":"https://api.github.com/repos/spinnaker/spinnaker/statuses/3eda4d3550e227e7e3d5b2f366228c01c0e4fc5e","head":{"label":"lwander:simplify_gcr","ref":"simplify_gcr","sha":"3eda4d3550e227e7e3d5b2f366228c01c0e4fc5e","user":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"repo":{"id":47216167,"name":"spinnaker","full_name":"lwander/spinnaker","owner":{"login":"lwander","id":4874941,"avatar_url":"https://avatars.githubusercontent.com/u/4874941?v=3","gravatar_id":"","url":"https://api.github.com/users/lwander","html_url":"https://github.com/lwander","followers_url":"https://api.github.com/users/lwander/followers","following_url":"https://api.github.com/users/lwander/following{/other_user}","gists_url":"https://api.github.com/users/lwander/gists{/gist_id}","starred_url":"https://api.github.com/users/lwander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwander/subscriptions","organizations_url":"https://api.github.com/users/lwander/orgs","repos_url":"https://api.github.com/users/lwander/repos","events_url":"https://api.github.com/users/lwander/events{/privacy}","received_events_url":"https://api.github.com/users/lwander/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lwander/spinnaker","description":"Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.","fork":true,"url":"https://api.github.com/repos/lwander/spinnaker","forks_url":"https://api.github.com/repos/lwander/spinnaker/forks","keys_url":"https://api.github.com/repos/lwander/spinnaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lwander/spinnaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lwander/spinnaker/teams","hooks_url":"https://api.github.com/repos/lwander/spinnaker/hooks","issue_events_url":"https://api.github.com/repos/lwander/spinnaker/issues/events{/number}","events_url":"https://api.github.com/repos/lwander/spinnaker/events","assignees_url":"https://api.github.com/repos/lwander/spinnaker/assignees{/user}","branches_url":"https://api.github.com/repos/lwander/spinnaker/branches{/branch}","tags_url":"https://api.github.com/repos/lwander/spinnaker/tags","blobs_url":"https://api.github.com/repos/lwander/spinnaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lwander/spinnaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lwander/spinnaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/lwander/spinnaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lwander/spinnaker/statuses/{sha}","languages_url":"https://api.github.com/repos/lwander/spinnaker/languages","stargazers_url":"https://api.github.com/repos/lwander/spinnaker/stargazers","contributors_url":"https://api.github.com/repos/lwander/spinnaker/contributors","subscribers_url":"https://api.github.com/repos/lwander/spinnaker/subscribers","subscription_url":"https://api.github.com/repos/lwander/spinnaker/subscription","commits_url":"https://api.github.com/repos/lwander/spinnaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/lwander/spinnaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/lwander/spinnaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/lwander/spinnaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/lwander/spinnaker/contents/{+path}","compare_url":"https://api.github.com/repos/lwander/spinnaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lwander/spinnaker/merges","archive_url":"https://api.github.com/repos/lwander/spinnaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lwander/spinnaker/downloads","issues_url":"https://api.github.com/repos/lwander/spinnaker/issues{/number}","pulls_url":"https://api.github.com/repos/lwander/spinnaker/pulls{/number}","milestones_url":"https://api.github.com/repos/lwander/spinnaker/milestones{/number}","notifications_url":"https://api.github.com/repos/lwander/spinnaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lwander/spinnaker/labels{/name}","releases_url":"https://api.github.com/repos/lwander/spinnaker/releases{/id}","deployments_url":"https://api.github.com/repos/lwander/spinnaker/deployments","created_at":"2015-12-01T20:41:34Z","updated_at":"2016-03-14T19:27:01Z","pushed_at":"2016-09-26T15:02:00Z","git_url":"git://github.com/lwander/spinnaker.git","ssh_url":"git@github.com:lwander/spinnaker.git","clone_url":"https://github.com/lwander/spinnaker.git","svn_url":"https://github.com/lwander/spinnaker","homepage":"","size":1650,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spinnaker:master","ref":"master","sha":"300b8d440e5bf003d34a08bdb0bc16fffb5129f0","user":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars.githubusercontent.com/u/7634182?v=3","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"repo":{"id":21436816,"name":"spinnaker","full_name":"spinnaker/spinnaker","owner":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars.githubusercontent.com/u/7634182?v=3","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spinnaker/spinnaker","description":"Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.","fork":false,"url":"https://api.github.com/repos/spinnaker/spinnaker","forks_url":"https://api.github.com/repos/spinnaker/spinnaker/forks","keys_url":"https://api.github.com/repos/spinnaker/spinnaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spinnaker/spinnaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spinnaker/spinnaker/teams","hooks_url":"https://api.github.com/repos/spinnaker/spinnaker/hooks","issue_events_url":"https://api.github.com/repos/spinnaker/spinnaker/issues/events{/number}","events_url":"https://api.github.com/repos/spinnaker/spinnaker/events","assignees_url":"https://api.github.com/repos/spinnaker/spinnaker/assignees{/user}","branches_url":"https://api.github.com/repos/spinnaker/spinnaker/branches{/branch}","tags_url":"https://api.github.com/repos/spinnaker/spinnaker/tags","blobs_url":"https://api.github.com/repos/spinnaker/spinnaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spinnaker/spinnaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spinnaker/spinnaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/spinnaker/spinnaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spinnaker/spinnaker/statuses/{sha}","languages_url":"https://api.github.com/repos/spinnaker/spinnaker/languages","stargazers_url":"https://api.github.com/repos/spinnaker/spinnaker/stargazers","contributors_url":"https://api.github.com/repos/spinnaker/spinnaker/contributors","subscribers_url":"https://api.github.com/repos/spinnaker/spinnaker/subscribers","subscription_url":"https://api.github.com/repos/spinnaker/spinnaker/subscription","commits_url":"https://api.github.com/repos/spinnaker/spinnaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/spinnaker/spinnaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/spinnaker/spinnaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/spinnaker/spinnaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/spinnaker/spinnaker/contents/{+path}","compare_url":"https://api.github.com/repos/spinnaker/spinnaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spinnaker/spinnaker/merges","archive_url":"https://api.github.com/repos/spinnaker/spinnaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spinnaker/spinnaker/downloads","issues_url":"https://api.github.com/repos/spinnaker/spinnaker/issues{/number}","pulls_url":"https://api.github.com/repos/spinnaker/spinnaker/pulls{/number}","milestones_url":"https://api.github.com/repos/spinnaker/spinnaker/milestones{/number}","notifications_url":"https://api.github.com/repos/spinnaker/spinnaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spinnaker/spinnaker/labels{/name}","releases_url":"https://api.github.com/repos/spinnaker/spinnaker/releases{/id}","deployments_url":"https://api.github.com/repos/spinnaker/spinnaker/deployments","created_at":"2014-07-02T19:02:36Z","updated_at":"2016-09-26T15:59:38Z","pushed_at":"2016-09-26T15:02:35Z","git_url":"git://github.com/spinnaker/spinnaker.git","ssh_url":"git@github.com:spinnaker/spinnaker.git","clone_url":"https://github.com/spinnaker/spinnaker.git","svn_url":"https://github.com/spinnaker/spinnaker","homepage":"","size":3173,"stargazers_count":2362,"watchers_count":2362,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":316,"mirror_url":null,"open_issues_count":133,"forks":316,"open_issues":133,"watchers":2362,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170"},"html":{"href":"https://github.com/spinnaker/spinnaker/pull/1170"},"issue":{"href":"https://api.github.com/repos/spinnaker/spinnaker/issues/1170"},"comments":{"href":"https://api.github.com/repos/spinnaker/spinnaker/issues/1170/comments"},"review_comments":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170/comments"},"review_comment":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spinnaker/spinnaker/pulls/1170/commits"},"statuses":{"href":"https://api.github.com/repos/spinnaker/spinnaker/statuses/3eda4d3550e227e7e3d5b2f366228c01c0e4fc5e"}}}}
{"actor":{"display_login":"lwander"}}