{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/27256435","id":27256435,"diff_hunk":"@@ -2154,6 +2156,65 @@ func TestMakeEnvironmentVariables(t *testing.T) {\n \t\t\t\t\"KUBERNETES_RO_PORT_8087_TCP_ADDR=1.2.3.7\"),\n \t\t\t21,\n \t\t},\n+\t\t{\n+\t\t\t\"simple substitution\",\n+\t\t\t&api.Pod{ObjectMeta: api.ObjectMeta{Namespace: \"unknown\", Name: \"test-pod\"}},\n+\t\t\t&api.Container{\n+\t\t\t\tEnv: []api.EnvVar{\n+\t\t\t\t\t{Name: \"BAR\", Value: \"bar\"},\n+\t\t\t\t\t{Name: \"FOO\", Value: \"${BAR}\"},\n+\t\t\t\t},\n+\t\t\t},\n+\t\t\t\"kubernetes\",\n+\t\t\ttrue,\n+\t\t\tutil.NewStringSet(\n+\t\t\t\t\"BAR=bar\",\n+\t\t\t\t\"FOO=bar\",\n+\t\t\t),\n+\t\t\t2,\n+\t\t},\n+\t\t{\n+\t\t\t\"slightly more complex substitution\",\n+\t\t\t&api.Pod{ObjectMeta: api.ObjectMeta{Namespace: \"unknown\", Name: \"test-pod\"}},\n+\t\t\t&api.Container{\n+\t\t\t\tEnv: []api.EnvVar{\n+\t\t\t\t\t{Name: \"BAR\", Value: \"bar\"},","path":"pkg/kubelet/kubelet_test.go","position":96,"original_position":96,"commit_id":"ad57f79c7242c6af607cc4af6804b161ec5792b6","original_commit_id":"ad57f79c7242c6af607cc4af6804b161ec5792b6","user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"body":"What will Docker's transitive expansion do for us? I looked at the code, but have forgotten already. I'd rather define a simpler mechanism to populate environment variables with Kubernetes data, and then rely upon Docker and/or the shell for more general expansion/substitution.","created_at":"2015-03-26T21:10:56Z","updated_at":"2015-03-26T21:10:56Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000#discussion_r27256435","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/27256435"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000#discussion_r27256435"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000","id":32047656,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6000","number":6000,"state":"open","locked":false,"title":"Resolve env vars in kubelet; add downward API env for pod name","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":"As discussed in #2316; also relevant to #386 ","created_at":"2015-03-26T18:39:40Z","updated_at":"2015-03-26T21:10:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e307081546d841bb9f073785ece3c7a705e09b3","assignee":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6000/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/ad57f79c7242c6af607cc4af6804b161ec5792b6","head":{"label":"pmorie:env-resolution","ref":"env-resolution","sha":"ad57f79c7242c6af607cc4af6804b161ec5792b6","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-03-24T18:36:46Z","pushed_at":"2015-03-26T18:38:36Z","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":39769,"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":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"87ac163662bd591e115c766f65b6639e8e3fb837","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-03-26T21:06:25Z","pushed_at":"2015-03-26T21:06:25Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":"http://kubernetes.io","size":116806,"stargazers_count":6769,"watchers_count":6769,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1282,"mirror_url":null,"open_issues_count":799,"forks":1282,"open_issues":799,"watchers":6769,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6000"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6000"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6000/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6000/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/ad57f79c7242c6af607cc4af6804b161ec5792b6"}}}}