{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/helm/pulls/comments/106054714","pull_request_review_id":26947241,"id":106054714,"diff_hunk":"@@ -383,10 +389,94 @@ func WithMaxHistory(max int32) HistoryOption {\n \t}\n }\n \n-// NewContext creates a versioned context.\n+// NewContext creates a versioned context with kubernetes client data.\n func NewContext() context.Context {\n-\tmd := metadata.Pairs(\"x-helm-api-client\", version.Version)\n-\treturn metadata.NewContext(context.TODO(), md)\n+\treturn metadata.NewContext(\n+\t\tcontext.TODO(),\n+\t\tmetadata.Join(\n+\t\t\tmetadata.New(\n+\t\t\t\textractKubeConfig()),\n+\t\t\tmetadata.New(map[string]string{\n+\t\t\t\t\"x-helm-api-client\": version.Version,\n+\t\t\t}),\n+\t\t),\n+\t)\n+}\n+\n+func extractKubeConfig() map[string]string {\n+\tconfigData := make(map[string]string)\n+\tclientConfig := cmdutil.DefaultClientConfig(pflag.NewFlagSet(\"\", pflag.ContinueOnError))\n+\tc, err := clientConfig.ClientConfig()\n+\tif err != nil {\n+\t\tlog.Println(\"Failed to extract kubeconfig\")\n+\t\treturn configData\n+\t}\n+\n+\t// Kube APIServer URL\n+\tif len(c.Host) != 0 {\n+\t\tconfigData[string(K8sServer)] = c.Host\n+\t}\n+\n+\tif c.AuthProvider != nil {\n+\t\tswitch c.AuthProvider.Name {\n+\t\tcase \"gcp\":\n+\t\t\tconfigData[string(Authorization)] = \"Bearer \" + c.AuthProvider.Config[\"access_token\"]\n+\t\tcase \"oidc\":\n+\t\t\tconfigData[string(Authorization)] = \"Bearer \" + c.AuthProvider.Config[\"id-token\"]\n+\t\tdefault:\n+\t\t\tpanic(\"Unknown auth provider: \" + c.AuthProvider.Name)\n+\t\t}\n+\t}\n+\n+\tif len(c.BearerToken) != 0 {\n+\t\tconfigData[string(Authorization)] = \"Bearer \" + c.BearerToken\n+\t}\n+\n+\tif len(c.Username) != 0 && len(c.Password) != 0 {\n+\t\tconfigData[string(Authorization)] = \"Basic \" + base64.StdEncoding.EncodeToString([]byte(c.Username+\":\"+c.Password))\n+\t}\n+\n+\tif len(string(c.CAData)) != 0 {\n+\t\tconfigData[string(K8sCertificateAuthority)] = base64.StdEncoding.EncodeToString(bytes.TrimSpace(c.CAData))\n+\t}\n+\n+\tif len(string(c.TLSClientConfig.KeyData)) != 0 {\n+\t\tconfigData[string(K8sClientKey)] = base64.StdEncoding.EncodeToString(c.TLSClientConfig.KeyData)\n+\t}\n+\n+\tif len(string(c.TLSClientConfig.CertData)) != 0 {\n+\t\tconfigData[string(K8sClientCertificate)] = base64.StdEncoding.EncodeToString(c.TLSClientConfig.CertData)\n+\t}\n+\n+\tif len(c.TLSClientConfig.CAFile) != 0 {","path":"pkg/helm/option.go","position":88,"original_position":88,"commit_id":"bca5a066477e277efe87eaf0242022897ef1e3f2","original_commit_id":"bca5a066477e277efe87eaf0242022897ef1e3f2","user":{"login":"adamreese","id":2347529,"avatar_url":"https://avatars2.githubusercontent.com/u/2347529?v=3","gravatar_id":"","url":"https://api.github.com/users/adamreese","html_url":"https://github.com/adamreese","followers_url":"https://api.github.com/users/adamreese/followers","following_url":"https://api.github.com/users/adamreese/following{/other_user}","gists_url":"https://api.github.com/users/adamreese/gists{/gist_id}","starred_url":"https://api.github.com/users/adamreese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamreese/subscriptions","organizations_url":"https://api.github.com/users/adamreese/orgs","repos_url":"https://api.github.com/users/adamreese/repos","events_url":"https://api.github.com/users/adamreese/events{/privacy}","received_events_url":"https://api.github.com/users/adamreese/received_events","type":"User","site_admin":false},"body":"tiller already has the CA file","created_at":"2017-03-14T23:37:15Z","updated_at":"2017-03-14T23:58:29Z","html_url":"https://github.com/kubernetes/helm/pull/1932#discussion_r106054714","pull_request_url":"https://api.github.com/repos/kubernetes/helm/pulls/1932","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/comments/106054714"},"html":{"href":"https://github.com/kubernetes/helm/pull/1932#discussion_r106054714"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/1932"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/helm/pulls/1932","id":105463640,"html_url":"https://github.com/kubernetes/helm/pull/1932","diff_url":"https://github.com/kubernetes/helm/pull/1932.diff","patch_url":"https://github.com/kubernetes/helm/pull/1932.patch","issue_url":"https://api.github.com/repos/kubernetes/helm/issues/1932","number":1932,"state":"open","locked":false,"title":"Pass user authentication to Tiller","user":{"login":"TamalSaha","id":94814,"avatar_url":"https://avatars2.githubusercontent.com/u/94814?v=3","gravatar_id":"","url":"https://api.github.com/users/TamalSaha","html_url":"https://github.com/TamalSaha","followers_url":"https://api.github.com/users/TamalSaha/followers","following_url":"https://api.github.com/users/TamalSaha/following{/other_user}","gists_url":"https://api.github.com/users/TamalSaha/gists{/gist_id}","starred_url":"https://api.github.com/users/TamalSaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TamalSaha/subscriptions","organizations_url":"https://api.github.com/users/TamalSaha/orgs","repos_url":"https://api.github.com/users/TamalSaha/repos","events_url":"https://api.github.com/users/TamalSaha/events{/privacy}","received_events_url":"https://api.github.com/users/TamalSaha/received_events","type":"User","site_admin":false},"body":"First step for #1918 ","created_at":"2017-02-09T16:32:42Z","updated_at":"2017-03-14T23:58:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e967dd6ee2491ecdafb9a19ef4e3bd89ac4abd44","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kubernetes/helm/milestones/30","html_url":"https://github.com/kubernetes/helm/milestone/30","labels_url":"https://api.github.com/repos/kubernetes/helm/milestones/30/labels","id":2280951,"number":30,"title":"2.3.0","description":"","creator":{"login":"technosophos","id":89193,"avatar_url":"https://avatars2.githubusercontent.com/u/89193?v=3","gravatar_id":"","url":"https://api.github.com/users/technosophos","html_url":"https://github.com/technosophos","followers_url":"https://api.github.com/users/technosophos/followers","following_url":"https://api.github.com/users/technosophos/following{/other_user}","gists_url":"https://api.github.com/users/technosophos/gists{/gist_id}","starred_url":"https://api.github.com/users/technosophos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technosophos/subscriptions","organizations_url":"https://api.github.com/users/technosophos/orgs","repos_url":"https://api.github.com/users/technosophos/repos","events_url":"https://api.github.com/users/technosophos/events{/privacy}","received_events_url":"https://api.github.com/users/technosophos/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":39,"state":"open","created_at":"2017-01-26T20:24:09Z","updated_at":"2017-03-14T19:02:49Z","due_on":"2017-04-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/kubernetes/helm/pulls/1932/commits","review_comments_url":"https://api.github.com/repos/kubernetes/helm/pulls/1932/comments","review_comment_url":"https://api.github.com/repos/kubernetes/helm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/helm/issues/1932/comments","statuses_url":"https://api.github.com/repos/kubernetes/helm/statuses/bca5a066477e277efe87eaf0242022897ef1e3f2","head":{"label":"appscode:tiller-auth","ref":"tiller-auth","sha":"bca5a066477e277efe87eaf0242022897ef1e3f2","user":{"login":"appscode","id":13395825,"avatar_url":"https://avatars1.githubusercontent.com/u/13395825?v=3","gravatar_id":"","url":"https://api.github.com/users/appscode","html_url":"https://github.com/appscode","followers_url":"https://api.github.com/users/appscode/followers","following_url":"https://api.github.com/users/appscode/following{/other_user}","gists_url":"https://api.github.com/users/appscode/gists{/gist_id}","starred_url":"https://api.github.com/users/appscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appscode/subscriptions","organizations_url":"https://api.github.com/users/appscode/orgs","repos_url":"https://api.github.com/users/appscode/repos","events_url":"https://api.github.com/users/appscode/events{/privacy}","received_events_url":"https://api.github.com/users/appscode/received_events","type":"Organization","site_admin":false},"repo":{"id":76449129,"name":"helm","full_name":"appscode/helm","owner":{"login":"appscode","id":13395825,"avatar_url":"https://avatars1.githubusercontent.com/u/13395825?v=3","gravatar_id":"","url":"https://api.github.com/users/appscode","html_url":"https://github.com/appscode","followers_url":"https://api.github.com/users/appscode/followers","following_url":"https://api.github.com/users/appscode/following{/other_user}","gists_url":"https://api.github.com/users/appscode/gists{/gist_id}","starred_url":"https://api.github.com/users/appscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appscode/subscriptions","organizations_url":"https://api.github.com/users/appscode/orgs","repos_url":"https://api.github.com/users/appscode/repos","events_url":"https://api.github.com/users/appscode/events{/privacy}","received_events_url":"https://api.github.com/users/appscode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appscode/helm","description":"The Kubernetes Package Manager","fork":true,"url":"https://api.github.com/repos/appscode/helm","forks_url":"https://api.github.com/repos/appscode/helm/forks","keys_url":"https://api.github.com/repos/appscode/helm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appscode/helm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appscode/helm/teams","hooks_url":"https://api.github.com/repos/appscode/helm/hooks","issue_events_url":"https://api.github.com/repos/appscode/helm/issues/events{/number}","events_url":"https://api.github.com/repos/appscode/helm/events","assignees_url":"https://api.github.com/repos/appscode/helm/assignees{/user}","branches_url":"https://api.github.com/repos/appscode/helm/branches{/branch}","tags_url":"https://api.github.com/repos/appscode/helm/tags","blobs_url":"https://api.github.com/repos/appscode/helm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appscode/helm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appscode/helm/git/refs{/sha}","trees_url":"https://api.github.com/repos/appscode/helm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appscode/helm/statuses/{sha}","languages_url":"https://api.github.com/repos/appscode/helm/languages","stargazers_url":"https://api.github.com/repos/appscode/helm/stargazers","contributors_url":"https://api.github.com/repos/appscode/helm/contributors","subscribers_url":"https://api.github.com/repos/appscode/helm/subscribers","subscription_url":"https://api.github.com/repos/appscode/helm/subscription","commits_url":"https://api.github.com/repos/appscode/helm/commits{/sha}","git_commits_url":"https://api.github.com/repos/appscode/helm/git/commits{/sha}","comments_url":"https://api.github.com/repos/appscode/helm/comments{/number}","issue_comment_url":"https://api.github.com/repos/appscode/helm/issues/comments{/number}","contents_url":"https://api.github.com/repos/appscode/helm/contents/{+path}","compare_url":"https://api.github.com/repos/appscode/helm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appscode/helm/merges","archive_url":"https://api.github.com/repos/appscode/helm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appscode/helm/downloads","issues_url":"https://api.github.com/repos/appscode/helm/issues{/number}","pulls_url":"https://api.github.com/repos/appscode/helm/pulls{/number}","milestones_url":"https://api.github.com/repos/appscode/helm/milestones{/number}","notifications_url":"https://api.github.com/repos/appscode/helm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appscode/helm/labels{/name}","releases_url":"https://api.github.com/repos/appscode/helm/releases{/id}","deployments_url":"https://api.github.com/repos/appscode/helm/deployments","created_at":"2016-12-14T10:23:33Z","updated_at":"2017-02-08T14:14:09Z","pushed_at":"2017-02-28T10:10:33Z","git_url":"git://github.com/appscode/helm.git","ssh_url":"git@github.com:appscode/helm.git","clone_url":"https://github.com/appscode/helm.git","svn_url":"https://github.com/appscode/helm","homepage":"","size":4353,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"fc315ab59850ddd1b9b4959c89ef008fef5cdf89","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars1.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":43723161,"name":"helm","full_name":"kubernetes/helm","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars1.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/helm","description":"The Kubernetes Package Manager","fork":false,"url":"https://api.github.com/repos/kubernetes/helm","forks_url":"https://api.github.com/repos/kubernetes/helm/forks","keys_url":"https://api.github.com/repos/kubernetes/helm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/helm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/helm/teams","hooks_url":"https://api.github.com/repos/kubernetes/helm/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/helm/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/helm/events","assignees_url":"https://api.github.com/repos/kubernetes/helm/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/helm/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/helm/tags","blobs_url":"https://api.github.com/repos/kubernetes/helm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/helm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/helm/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/helm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/helm/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/helm/languages","stargazers_url":"https://api.github.com/repos/kubernetes/helm/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/helm/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/helm/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/helm/subscription","commits_url":"https://api.github.com/repos/kubernetes/helm/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/helm/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/helm/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/helm/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/helm/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/helm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/helm/merges","archive_url":"https://api.github.com/repos/kubernetes/helm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/helm/downloads","issues_url":"https://api.github.com/repos/kubernetes/helm/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/helm/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/helm/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/helm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/helm/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/helm/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/helm/deployments","created_at":"2015-10-06T01:07:32Z","updated_at":"2017-03-14T21:42:49Z","pushed_at":"2017-03-14T22:10:04Z","git_url":"git://github.com/kubernetes/helm.git","ssh_url":"git@github.com:kubernetes/helm.git","clone_url":"https://github.com/kubernetes/helm.git","svn_url":"https://github.com/kubernetes/helm","homepage":"","size":4663,"stargazers_count":1169,"watchers_count":1169,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":382,"mirror_url":null,"open_issues_count":165,"forks":382,"open_issues":165,"watchers":1169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/1932"},"html":{"href":"https://github.com/kubernetes/helm/pull/1932"},"issue":{"href":"https://api.github.com/repos/kubernetes/helm/issues/1932"},"comments":{"href":"https://api.github.com/repos/kubernetes/helm/issues/1932/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/1932/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/helm/pulls/1932/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/helm/statuses/bca5a066477e277efe87eaf0242022897ef1e3f2"}}}}
{"actor":{"display_login":"adamreese"}}