{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47049690","id":47049690,"diff_hunk":"@@ -1430,11 +1430,20 @@ func (kl *Kubelet) makeEnvironmentVariables(pod *api.Pod, container *api.Contain\n \t\tif runtimeVal != \"\" {\n \t\t\t// Step 1a: expand variable references\n \t\t\truntimeVal = expansion.Expand(runtimeVal, mappingFunc)\n-\t\t} else if envVar.ValueFrom != nil && envVar.ValueFrom.FieldRef != nil {\n-\t\t\t// Step 1b: resolve alternate env var sources\n-\t\t\truntimeVal, err = kl.podFieldSelectorRuntimeValue(envVar.ValueFrom.FieldRef, pod)\n-\t\t\tif err != nil {\n-\t\t\t\treturn result, err\n+\t\t} else if envVar.ValueFrom != nil {\n+\t\t\tswitch {\n+\n+\t\t\tcase envVar.ValueFrom.FieldRef != nil:\n+\t\t\t\t// Step 1b: resolve alternate env var sources\n+\t\t\t\truntimeVal, err = kl.podFieldSelectorRuntimeValue(envVar.ValueFrom.FieldRef, pod)\n+\t\t\t\tif err != nil {\n+\t\t\t\t\treturn result, err\n+\t\t\t\t}\n+\t\t\tcase envVar.ValueFrom.SecretKeyRef != nil:\n+\t\t\t\truntimeVal, err = kl.secretKeySelectorRuntimeValue(envVar.ValueFrom.SecretKeyRef, pod)","path":"pkg/kubelet/kubelet.go","position":19,"original_position":19,"commit_id":"359c29429d89106f438c0b3ce917c215ec237ecd","original_commit_id":"359c29429d89106f438c0b3ce917c215ec237ecd","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"it will probably be likely to use the same secret multiple times in a single pod (multiple keys, or one key in multiple containers)... pass something to secretKeySelectorRuntimeValue to let it avoid looking up the same secret multiple times per pod?","created_at":"2015-12-09T04:14:13Z","updated_at":"2015-12-09T04:14:13Z","html_url":"https://github.com/kubernetes/kubernetes/pull/18298#discussion_r47049690","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47049690"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18298#discussion_r47049690"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298","id":52866931,"html_url":"https://github.com/kubernetes/kubernetes/pull/18298","diff_url":"https://github.com/kubernetes/kubernetes/pull/18298.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/18298.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18298","number":18298,"state":"open","locked":false,"title":"Expose secret keys in environment variables","user":{"login":"pmorie","id":366488,"avatar_url":"https://avatars.githubusercontent.com/u/366488?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"body":"Fixes #4710.  @erictune @thockin \r\n\r\ncc @resouer \r\ncc @bgrant0607 for API changes","created_at":"2015-12-07T16:30:09Z","updated_at":"2015-12-09T04:14:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"397083d9f2c14150ee3250fff5cc269667f8124c","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18298/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/359c29429d89106f438c0b3ce917c215ec237ecd","head":{"label":"pmorie:secret-env","ref":"secret-env","sha":"359c29429d89106f438c0b3ce917c215ec237ecd","user":{"login":"pmorie","id":366488,"avatar_url":"https://avatars.githubusercontent.com/u/366488?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"repo":{"id":21654452,"name":"kubernetes","full_name":"pmorie/kubernetes","owner":{"login":"pmorie","id":366488,"avatar_url":"https://avatars.githubusercontent.com/u/366488?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pmorie/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/pmorie/kubernetes","forks_url":"https://api.github.com/repos/pmorie/kubernetes/forks","keys_url":"https://api.github.com/repos/pmorie/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pmorie/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pmorie/kubernetes/teams","hooks_url":"https://api.github.com/repos/pmorie/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/pmorie/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/pmorie/kubernetes/events","assignees_url":"https://api.github.com/repos/pmorie/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/pmorie/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/pmorie/kubernetes/tags","blobs_url":"https://api.github.com/repos/pmorie/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pmorie/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pmorie/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/pmorie/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pmorie/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/pmorie/kubernetes/languages","stargazers_url":"https://api.github.com/repos/pmorie/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/pmorie/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/pmorie/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/pmorie/kubernetes/subscription","commits_url":"https://api.github.com/repos/pmorie/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/pmorie/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/pmorie/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/pmorie/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/pmorie/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/pmorie/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pmorie/kubernetes/merges","archive_url":"https://api.github.com/repos/pmorie/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pmorie/kubernetes/downloads","issues_url":"https://api.github.com/repos/pmorie/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/pmorie/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/pmorie/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/pmorie/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pmorie/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/pmorie/kubernetes/releases{/id}","created_at":"2014-07-09T14:06:25Z","updated_at":"2015-08-13T02:02:33Z","pushed_at":"2015-12-08T18:32:33Z","git_url":"git://github.com/pmorie/kubernetes.git","ssh_url":"git@github.com:pmorie/kubernetes.git","clone_url":"https://github.com/pmorie/kubernetes.git","svn_url":"https://github.com/pmorie/kubernetes","homepage":null,"size":140800,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"33eda2ffb52c59eff55d30641d2aefae53fa8e48","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.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":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.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/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-12-09T03:45:30Z","pushed_at":"2015-12-09T02:54:13Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":298027,"stargazers_count":11683,"watchers_count":11683,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3161,"mirror_url":null,"open_issues_count":2543,"forks":3161,"open_issues":2543,"watchers":11683,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18298"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18298"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18298/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18298/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/359c29429d89106f438c0b3ce917c215ec237ecd"}}}}