{"action":"created","comment":{"url":"https://api.github.com/repos/jenkins-x/jx/pulls/comments/237814156","pull_request_review_id":180205058,"id":237814156,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzgxNDE1Ng==","diff_hunk":"@@ -0,0 +1,65 @@\n+package secrets\n+\n+import (\n+\t\"github.com/jenkins-x/jx/pkg/kube\"\n+\t\"github.com/sirupsen/logrus\"\n+\t\"k8s.io/api/core/v1\"\n+\t\"k8s.io/client-go/kubernetes\"\n+)\n+\n+const vaultSecretsMarker = \"useVaultForSecrets\"\n+\n+type SecretLocation interface {\n+\t// InVault returns whether secrets are stored in Vault\n+\tInVault() bool\n+\t// SetInVault sets whether secrets are stored in Vault or not\n+\tSetInVault(useVault bool)\n+}\n+\n+type secretLocation struct {\n+\tkubeClient kubernetes.Interface\n+\tnamespace  string\n+\tusingVault *bool // use a tri-state boolean. nil means uninitialised (so need to lookup from cluster)\n+}\n+\n+// NewSecretLocation creates a SecretLocation\n+func NewSecretLocation(kubeClient kubernetes.Interface, namespace string) SecretLocation {\n+\treturn &secretLocation{\n+\t\tkubeClient: kubeClient,\n+\t\tnamespace:  namespace,\n+\t}\n+}\n+\n+// UsingVaultForSecrets returns true if the cluster has been configured to store secrets in vault\n+func (s *secretLocation) InVault() bool {\n+\tif s.usingVault == nil {\n+\t\tconfigMap := getInstallConfigMap(s.kubeClient, s.namespace)\n+\t\tb := configMap[vaultSecretsMarker] != \"\"","path":"pkg/io/secrets/secret_locations.go","position":37,"original_position":37,"commit_id":"76a7f980ee221eea0ed1c3a25887ebc9d1a7485b","original_commit_id":"76a7f980ee221eea0ed1c3a25887ebc9d1a7485b","user":{"login":"ccojocar","id":591127,"node_id":"MDQ6VXNlcjU5MTEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/591127?v=4","gravatar_id":"","url":"https://api.github.com/users/ccojocar","html_url":"https://github.com/ccojocar","followers_url":"https://api.github.com/users/ccojocar/followers","following_url":"https://api.github.com/users/ccojocar/following{/other_user}","gists_url":"https://api.github.com/users/ccojocar/gists{/gist_id}","starred_url":"https://api.github.com/users/ccojocar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccojocar/subscriptions","organizations_url":"https://api.github.com/users/ccojocar/orgs","repos_url":"https://api.github.com/users/ccojocar/repos","events_url":"https://api.github.com/users/ccojocar/events{/privacy}","received_events_url":"https://api.github.com/users/ccojocar/received_events","type":"User","site_admin":false},"body":"I think you need to handle nil. It case the configmap does not exists, the `getInstallConfigMap` will only log a message and return nil.","created_at":"2018-11-30T10:30:28Z","updated_at":"2018-11-30T10:33:41Z","html_url":"https://github.com/jenkins-x/jx/pull/2375#discussion_r237814156","pull_request_url":"https://api.github.com/repos/jenkins-x/jx/pulls/2375","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/comments/237814156"},"html":{"href":"https://github.com/jenkins-x/jx/pull/2375#discussion_r237814156"},"pull_request":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/2375"}}},"pull_request":{"url":"https://api.github.com/repos/jenkins-x/jx/pulls/2375","id":234685797,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0Njg1Nzk3","html_url":"https://github.com/jenkins-x/jx/pull/2375","diff_url":"https://github.com/jenkins-x/jx/pull/2375.diff","patch_url":"https://github.com/jenkins-x/jx/pull/2375.patch","issue_url":"https://api.github.com/repos/jenkins-x/jx/issues/2375","number":2375,"state":"open","locked":false,"title":"feat(vault): Store a flag in the jx-install-config to denote if secrets are to be stored in vault","user":{"login":"agentgonzo","id":1652511,"node_id":"MDQ6VXNlcjE2NTI1MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1652511?v=4","gravatar_id":"","url":"https://api.github.com/users/agentgonzo","html_url":"https://github.com/agentgonzo","followers_url":"https://api.github.com/users/agentgonzo/followers","following_url":"https://api.github.com/users/agentgonzo/following{/other_user}","gists_url":"https://api.github.com/users/agentgonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/agentgonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentgonzo/subscriptions","organizations_url":"https://api.github.com/users/agentgonzo/orgs","repos_url":"https://api.github.com/users/agentgonzo/repos","events_url":"https://api.github.com/users/agentgonzo/events{/privacy}","received_events_url":"https://api.github.com/users/agentgonzo/received_events","type":"User","site_admin":false},"body":"If `jx install --vault` is run, secrets get stored in vault. With this PR, it will now update the `jx-install-config` configmap with a new entry: `useVaultForSecrets: \"true\"` that tells the client that secrets are stored in vault (as opposed to on the file systme).\n\nThis can (and is) queried by the client to determine whether to load the secrets from vault.","created_at":"2018-11-29T15:43:46Z","updated_at":"2018-11-30T10:33:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e736786426daed44cd7e7dcc8c735b5478f60fab","assignee":{"login":"ccojocar","id":591127,"node_id":"MDQ6VXNlcjU5MTEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/591127?v=4","gravatar_id":"","url":"https://api.github.com/users/ccojocar","html_url":"https://github.com/ccojocar","followers_url":"https://api.github.com/users/ccojocar/followers","following_url":"https://api.github.com/users/ccojocar/following{/other_user}","gists_url":"https://api.github.com/users/ccojocar/gists{/gist_id}","starred_url":"https://api.github.com/users/ccojocar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccojocar/subscriptions","organizations_url":"https://api.github.com/users/ccojocar/orgs","repos_url":"https://api.github.com/users/ccojocar/repos","events_url":"https://api.github.com/users/ccojocar/events{/privacy}","received_events_url":"https://api.github.com/users/ccojocar/received_events","type":"User","site_admin":false},"assignees":[{"login":"ccojocar","id":591127,"node_id":"MDQ6VXNlcjU5MTEyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/591127?v=4","gravatar_id":"","url":"https://api.github.com/users/ccojocar","html_url":"https://github.com/ccojocar","followers_url":"https://api.github.com/users/ccojocar/followers","following_url":"https://api.github.com/users/ccojocar/following{/other_user}","gists_url":"https://api.github.com/users/ccojocar/gists{/gist_id}","starred_url":"https://api.github.com/users/ccojocar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccojocar/subscriptions","organizations_url":"https://api.github.com/users/ccojocar/orgs","repos_url":"https://api.github.com/users/ccojocar/repos","events_url":"https://api.github.com/users/ccojocar/events{/privacy}","received_events_url":"https://api.github.com/users/ccojocar/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"pmuir","id":157761,"node_id":"MDQ6VXNlcjE1Nzc2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/157761?v=4","gravatar_id":"","url":"https://api.github.com/users/pmuir","html_url":"https://github.com/pmuir","followers_url":"https://api.github.com/users/pmuir/followers","following_url":"https://api.github.com/users/pmuir/following{/other_user}","gists_url":"https://api.github.com/users/pmuir/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuir/subscriptions","organizations_url":"https://api.github.com/users/pmuir/orgs","repos_url":"https://api.github.com/users/pmuir/repos","events_url":"https://api.github.com/users/pmuir/events{/privacy}","received_events_url":"https://api.github.com/users/pmuir/received_events","type":"User","site_admin":false},{"login":"amuniz","id":1017585,"node_id":"MDQ6VXNlcjEwMTc1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1017585?v=4","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1016466107,"node_id":"MDU6TGFiZWwxMDE2NDY2MTA3","url":"https://api.github.com/repos/jenkins-x/jx/labels/size/L","name":"size/L","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jenkins-x/jx/pulls/2375/commits","review_comments_url":"https://api.github.com/repos/jenkins-x/jx/pulls/2375/comments","review_comment_url":"https://api.github.com/repos/jenkins-x/jx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkins-x/jx/issues/2375/comments","statuses_url":"https://api.github.com/repos/jenkins-x/jx/statuses/76a7f980ee221eea0ed1c3a25887ebc9d1a7485b","head":{"label":"agentgonzo:vault-in-use-flag","ref":"vault-in-use-flag","sha":"76a7f980ee221eea0ed1c3a25887ebc9d1a7485b","user":{"login":"agentgonzo","id":1652511,"node_id":"MDQ6VXNlcjE2NTI1MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1652511?v=4","gravatar_id":"","url":"https://api.github.com/users/agentgonzo","html_url":"https://github.com/agentgonzo","followers_url":"https://api.github.com/users/agentgonzo/followers","following_url":"https://api.github.com/users/agentgonzo/following{/other_user}","gists_url":"https://api.github.com/users/agentgonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/agentgonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentgonzo/subscriptions","organizations_url":"https://api.github.com/users/agentgonzo/orgs","repos_url":"https://api.github.com/users/agentgonzo/repos","events_url":"https://api.github.com/users/agentgonzo/events{/privacy}","received_events_url":"https://api.github.com/users/agentgonzo/received_events","type":"User","site_admin":false},"repo":{"id":154358426,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQzNTg0MjY=","name":"jx","full_name":"agentgonzo/jx","private":false,"owner":{"login":"agentgonzo","id":1652511,"node_id":"MDQ6VXNlcjE2NTI1MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1652511?v=4","gravatar_id":"","url":"https://api.github.com/users/agentgonzo","html_url":"https://github.com/agentgonzo","followers_url":"https://api.github.com/users/agentgonzo/followers","following_url":"https://api.github.com/users/agentgonzo/following{/other_user}","gists_url":"https://api.github.com/users/agentgonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/agentgonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentgonzo/subscriptions","organizations_url":"https://api.github.com/users/agentgonzo/orgs","repos_url":"https://api.github.com/users/agentgonzo/repos","events_url":"https://api.github.com/users/agentgonzo/events{/privacy}","received_events_url":"https://api.github.com/users/agentgonzo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/agentgonzo/jx","description":"jx is a command line tool for working with Jenkins X: automated CI/CD for Kubernetes","fork":true,"url":"https://api.github.com/repos/agentgonzo/jx","forks_url":"https://api.github.com/repos/agentgonzo/jx/forks","keys_url":"https://api.github.com/repos/agentgonzo/jx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agentgonzo/jx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agentgonzo/jx/teams","hooks_url":"https://api.github.com/repos/agentgonzo/jx/hooks","issue_events_url":"https://api.github.com/repos/agentgonzo/jx/issues/events{/number}","events_url":"https://api.github.com/repos/agentgonzo/jx/events","assignees_url":"https://api.github.com/repos/agentgonzo/jx/assignees{/user}","branches_url":"https://api.github.com/repos/agentgonzo/jx/branches{/branch}","tags_url":"https://api.github.com/repos/agentgonzo/jx/tags","blobs_url":"https://api.github.com/repos/agentgonzo/jx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agentgonzo/jx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agentgonzo/jx/git/refs{/sha}","trees_url":"https://api.github.com/repos/agentgonzo/jx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agentgonzo/jx/statuses/{sha}","languages_url":"https://api.github.com/repos/agentgonzo/jx/languages","stargazers_url":"https://api.github.com/repos/agentgonzo/jx/stargazers","contributors_url":"https://api.github.com/repos/agentgonzo/jx/contributors","subscribers_url":"https://api.github.com/repos/agentgonzo/jx/subscribers","subscription_url":"https://api.github.com/repos/agentgonzo/jx/subscription","commits_url":"https://api.github.com/repos/agentgonzo/jx/commits{/sha}","git_commits_url":"https://api.github.com/repos/agentgonzo/jx/git/commits{/sha}","comments_url":"https://api.github.com/repos/agentgonzo/jx/comments{/number}","issue_comment_url":"https://api.github.com/repos/agentgonzo/jx/issues/comments{/number}","contents_url":"https://api.github.com/repos/agentgonzo/jx/contents/{+path}","compare_url":"https://api.github.com/repos/agentgonzo/jx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agentgonzo/jx/merges","archive_url":"https://api.github.com/repos/agentgonzo/jx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agentgonzo/jx/downloads","issues_url":"https://api.github.com/repos/agentgonzo/jx/issues{/number}","pulls_url":"https://api.github.com/repos/agentgonzo/jx/pulls{/number}","milestones_url":"https://api.github.com/repos/agentgonzo/jx/milestones{/number}","notifications_url":"https://api.github.com/repos/agentgonzo/jx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agentgonzo/jx/labels{/name}","releases_url":"https://api.github.com/repos/agentgonzo/jx/releases{/id}","deployments_url":"https://api.github.com/repos/agentgonzo/jx/deployments","created_at":"2018-10-23T16:07:12Z","updated_at":"2018-11-29T11:07:49Z","pushed_at":"2018-11-30T10:25:54Z","git_url":"git://github.com/agentgonzo/jx.git","ssh_url":"git@github.com:agentgonzo/jx.git","clone_url":"https://github.com/agentgonzo/jx.git","svn_url":"https://github.com/agentgonzo/jx","homepage":"https://jenkins-x.io/","size":41703,"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":{"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":"jenkins-x:master","ref":"master","sha":"0806a9a1ca487f1895dad9d2d094a0628f28524a","user":{"login":"jenkins-x","id":34566050,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTY2MDUw","avatar_url":"https://avatars0.githubusercontent.com/u/34566050?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkins-x","html_url":"https://github.com/jenkins-x","followers_url":"https://api.github.com/users/jenkins-x/followers","following_url":"https://api.github.com/users/jenkins-x/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-x/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-x/subscriptions","organizations_url":"https://api.github.com/users/jenkins-x/orgs","repos_url":"https://api.github.com/users/jenkins-x/repos","events_url":"https://api.github.com/users/jenkins-x/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-x/received_events","type":"Organization","site_admin":false},"repo":{"id":116400734,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY0MDA3MzQ=","name":"jx","full_name":"jenkins-x/jx","private":false,"owner":{"login":"jenkins-x","id":34566050,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTY2MDUw","avatar_url":"https://avatars0.githubusercontent.com/u/34566050?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkins-x","html_url":"https://github.com/jenkins-x","followers_url":"https://api.github.com/users/jenkins-x/followers","following_url":"https://api.github.com/users/jenkins-x/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-x/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-x/subscriptions","organizations_url":"https://api.github.com/users/jenkins-x/orgs","repos_url":"https://api.github.com/users/jenkins-x/repos","events_url":"https://api.github.com/users/jenkins-x/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-x/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jenkins-x/jx","description":"Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Jenkins, Knative Build, Prow, Skaffold and Helm","fork":false,"url":"https://api.github.com/repos/jenkins-x/jx","forks_url":"https://api.github.com/repos/jenkins-x/jx/forks","keys_url":"https://api.github.com/repos/jenkins-x/jx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkins-x/jx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkins-x/jx/teams","hooks_url":"https://api.github.com/repos/jenkins-x/jx/hooks","issue_events_url":"https://api.github.com/repos/jenkins-x/jx/issues/events{/number}","events_url":"https://api.github.com/repos/jenkins-x/jx/events","assignees_url":"https://api.github.com/repos/jenkins-x/jx/assignees{/user}","branches_url":"https://api.github.com/repos/jenkins-x/jx/branches{/branch}","tags_url":"https://api.github.com/repos/jenkins-x/jx/tags","blobs_url":"https://api.github.com/repos/jenkins-x/jx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkins-x/jx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkins-x/jx/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkins-x/jx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkins-x/jx/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkins-x/jx/languages","stargazers_url":"https://api.github.com/repos/jenkins-x/jx/stargazers","contributors_url":"https://api.github.com/repos/jenkins-x/jx/contributors","subscribers_url":"https://api.github.com/repos/jenkins-x/jx/subscribers","subscription_url":"https://api.github.com/repos/jenkins-x/jx/subscription","commits_url":"https://api.github.com/repos/jenkins-x/jx/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkins-x/jx/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkins-x/jx/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkins-x/jx/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkins-x/jx/contents/{+path}","compare_url":"https://api.github.com/repos/jenkins-x/jx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkins-x/jx/merges","archive_url":"https://api.github.com/repos/jenkins-x/jx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkins-x/jx/downloads","issues_url":"https://api.github.com/repos/jenkins-x/jx/issues{/number}","pulls_url":"https://api.github.com/repos/jenkins-x/jx/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkins-x/jx/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkins-x/jx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkins-x/jx/labels{/name}","releases_url":"https://api.github.com/repos/jenkins-x/jx/releases{/id}","deployments_url":"https://api.github.com/repos/jenkins-x/jx/deployments","created_at":"2018-01-05T15:46:09Z","updated_at":"2018-11-29T17:18:48Z","pushed_at":"2018-11-30T10:25:55Z","git_url":"git://github.com/jenkins-x/jx.git","ssh_url":"git@github.com:jenkins-x/jx.git","clone_url":"https://github.com/jenkins-x/jx.git","svn_url":"https://github.com/jenkins-x/jx","homepage":"https://jenkins-x.io/","size":41716,"stargazers_count":1769,"watchers_count":1769,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":303,"mirror_url":null,"archived":false,"open_issues_count":487,"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":303,"open_issues":487,"watchers":1769,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/2375"},"html":{"href":"https://github.com/jenkins-x/jx/pull/2375"},"issue":{"href":"https://api.github.com/repos/jenkins-x/jx/issues/2375"},"comments":{"href":"https://api.github.com/repos/jenkins-x/jx/issues/2375/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/2375/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkins-x/jx/pulls/2375/commits"},"statuses":{"href":"https://api.github.com/repos/jenkins-x/jx/statuses/76a7f980ee221eea0ed1c3a25887ebc9d1a7485b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ccojocar"}}