{"action":"created","comment":{"url":"https://api.github.com/repos/istio/istio/pulls/comments/240436588","pull_request_review_id":183467306,"id":240436588,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDQzNjU4OA==","diff_hunk":"@@ -86,30 +97,56 @@ var (\n \t}\n )\n \n-func init() {\n-\tcaProvider := os.Getenv(caProvider)\n-\tif caProvider == \"\" {\n-\t\tlog.Error(\"CA Provider is missing\")\n-\t\tos.Exit(1)\n+func newSecretCache(serverOptions sds.Options) (workloadSecretCache, gatewaySecretCache *cache.SecretCache) {\n+\tif serverOptions.EnableWorkloadSDS {\n+\t\twSecretFetcher, err := secretfetcher.NewSecretFetcher(false, serverOptions.CAEndpoint, serverOptions.CAProviderName, true)\n+\t\tif err != nil {\n+\t\t\tlog.Errorf(\"failed to create secretFetcher for workload proxy: %v\", err)\n+\t\t\tos.Exit(1)\n+\t\t}\n+\t\tcacheOptions.TrustDomain = serverOptions.TrustDomain\n+\t\tcacheOptions.Plugins = sds.NewPlugins(serverOptions.PluginNames)\n+\t\tworkloadSecretCache = cache.NewSecretCache(wSecretFetcher, sds.NotifyProxy, cacheOptions)\n+\t} else {\n+\t\tworkloadSecretCache = nil\n \t}\n \n-\tcaAddr := os.Getenv(caAddress)\n-\tif caAddr == \"\" {\n-\t\tlog.Error(\"CA Endpoint is missing\")\n-\t\tos.Exit(1)\n+\tif serverOptions.EnableIngressGatewaySDS {\n+\t\tgSecretFetcher, err := secretfetcher.NewSecretFetcher(true, serverOptions.CAEndpoint, serverOptions.CAProviderName, true)\n+\t\tif err != nil {\n+\t\t\tlog.Errorf(\"failed to create secretFetcher for gateway proxy: %v\", err)\n+\t\t\tos.Exit(1)\n+\t\t}\n+\t\tcacheOptions.TrustDomain = serverOptions.TrustDomain","path":"security/cmd/node_agent_k8s/main.go","position":85,"original_position":85,"commit_id":"7c58b8575b385cf9c333377309649ac6411215a7","original_commit_id":"7c58b8575b385cf9c333377309649ac6411215a7","user":{"login":"quanjielin","id":32855694,"node_id":"MDQ6VXNlcjMyODU1Njk0","avatar_url":"https://avatars0.githubusercontent.com/u/32855694?v=4","gravatar_id":"","url":"https://api.github.com/users/quanjielin","html_url":"https://github.com/quanjielin","followers_url":"https://api.github.com/users/quanjielin/followers","following_url":"https://api.github.com/users/quanjielin/following{/other_user}","gists_url":"https://api.github.com/users/quanjielin/gists{/gist_id}","starred_url":"https://api.github.com/users/quanjielin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quanjielin/subscriptions","organizations_url":"https://api.github.com/users/quanjielin/orgs","repos_url":"https://api.github.com/users/quanjielin/repos","events_url":"https://api.github.com/users/quanjielin/events{/privacy}","received_events_url":"https://api.github.com/users/quanjielin/received_events","type":"User","site_admin":false},"body":"trustdomain and plugins is not used by ingress case today, so probably could be removed.","created_at":"2018-12-11T00:43:17Z","updated_at":"2018-12-11T00:43:18Z","html_url":"https://github.com/istio/istio/pull/10327#discussion_r240436588","pull_request_url":"https://api.github.com/repos/istio/istio/pulls/10327","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/comments/240436588"},"html":{"href":"https://github.com/istio/istio/pull/10327#discussion_r240436588"},"pull_request":{"href":"https://api.github.com/repos/istio/istio/pulls/10327"}}},"pull_request":{"url":"https://api.github.com/repos/istio/istio/pulls/10327","id":236716998,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NzE2OTk4","html_url":"https://github.com/istio/istio/pull/10327","diff_url":"https://github.com/istio/istio/pull/10327.diff","patch_url":"https://github.com/istio/istio/pull/10327.patch","issue_url":"https://api.github.com/repos/istio/istio/issues/10327","number":10327,"state":"open","locked":false,"title":"[WIP] Support node agent to watch k8s secrets.","user":{"login":"JimmyCYJ","id":28548492,"node_id":"MDQ6VXNlcjI4NTQ4NDky","avatar_url":"https://avatars0.githubusercontent.com/u/28548492?v=4","gravatar_id":"","url":"https://api.github.com/users/JimmyCYJ","html_url":"https://github.com/JimmyCYJ","followers_url":"https://api.github.com/users/JimmyCYJ/followers","following_url":"https://api.github.com/users/JimmyCYJ/following{/other_user}","gists_url":"https://api.github.com/users/JimmyCYJ/gists{/gist_id}","starred_url":"https://api.github.com/users/JimmyCYJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimmyCYJ/subscriptions","organizations_url":"https://api.github.com/users/JimmyCYJ/orgs","repos_url":"https://api.github.com/users/JimmyCYJ/repos","events_url":"https://api.github.com/users/JimmyCYJ/events{/privacy}","received_events_url":"https://api.github.com/users/JimmyCYJ/received_events","type":"User","site_admin":false},"body":"Support node agent to work as ingress gateway agent, that watches k8s secrets in namespace istio-ingress and returns key/cert in SDS response.\r\n\r\nDesign doc: https://docs.google.com/document/d/1agtVQADCk32mLwot8iygVGhHcP1Lna7G1Cne4Zwllgg/edit#","created_at":"2018-12-07T00:22:44Z","updated_at":"2018-12-11T00:43:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe583301e95cf043dd40b3958cd7fa9379cdef8a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"wattli","id":24381542,"node_id":"MDQ6VXNlcjI0MzgxNTQy","avatar_url":"https://avatars1.githubusercontent.com/u/24381542?v=4","gravatar_id":"","url":"https://api.github.com/users/wattli","html_url":"https://github.com/wattli","followers_url":"https://api.github.com/users/wattli/followers","following_url":"https://api.github.com/users/wattli/following{/other_user}","gists_url":"https://api.github.com/users/wattli/gists{/gist_id}","starred_url":"https://api.github.com/users/wattli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wattli/subscriptions","organizations_url":"https://api.github.com/users/wattli/orgs","repos_url":"https://api.github.com/users/wattli/repos","events_url":"https://api.github.com/users/wattli/events{/privacy}","received_events_url":"https://api.github.com/users/wattli/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":491318011,"node_id":"MDU6TGFiZWw0OTEzMTgwMTE=","url":"https://api.github.com/repos/istio/istio/labels/cla:%20yes","name":"cla: yes","color":"bfdadc","default":false},{"id":957605109,"node_id":"MDU6TGFiZWw5NTc2MDUxMDk=","url":"https://api.github.com/repos/istio/istio/labels/do-not-merge/work-in-progress","name":"do-not-merge/work-in-progress","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/istio/istio/pulls/10327/commits","review_comments_url":"https://api.github.com/repos/istio/istio/pulls/10327/comments","review_comment_url":"https://api.github.com/repos/istio/istio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/istio/issues/10327/comments","statuses_url":"https://api.github.com/repos/istio/istio/statuses/7c58b8575b385cf9c333377309649ac6411215a7","head":{"label":"JimmyCYJ:release-1.1","ref":"release-1.1","sha":"7c58b8575b385cf9c333377309649ac6411215a7","user":{"login":"JimmyCYJ","id":28548492,"node_id":"MDQ6VXNlcjI4NTQ4NDky","avatar_url":"https://avatars0.githubusercontent.com/u/28548492?v=4","gravatar_id":"","url":"https://api.github.com/users/JimmyCYJ","html_url":"https://github.com/JimmyCYJ","followers_url":"https://api.github.com/users/JimmyCYJ/followers","following_url":"https://api.github.com/users/JimmyCYJ/following{/other_user}","gists_url":"https://api.github.com/users/JimmyCYJ/gists{/gist_id}","starred_url":"https://api.github.com/users/JimmyCYJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimmyCYJ/subscriptions","organizations_url":"https://api.github.com/users/JimmyCYJ/orgs","repos_url":"https://api.github.com/users/JimmyCYJ/repos","events_url":"https://api.github.com/users/JimmyCYJ/events{/privacy}","received_events_url":"https://api.github.com/users/JimmyCYJ/received_events","type":"User","site_admin":false},"repo":{"id":134782388,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ3ODIzODg=","name":"istio","full_name":"JimmyCYJ/istio","private":false,"owner":{"login":"JimmyCYJ","id":28548492,"node_id":"MDQ6VXNlcjI4NTQ4NDky","avatar_url":"https://avatars0.githubusercontent.com/u/28548492?v=4","gravatar_id":"","url":"https://api.github.com/users/JimmyCYJ","html_url":"https://github.com/JimmyCYJ","followers_url":"https://api.github.com/users/JimmyCYJ/followers","following_url":"https://api.github.com/users/JimmyCYJ/following{/other_user}","gists_url":"https://api.github.com/users/JimmyCYJ/gists{/gist_id}","starred_url":"https://api.github.com/users/JimmyCYJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimmyCYJ/subscriptions","organizations_url":"https://api.github.com/users/JimmyCYJ/orgs","repos_url":"https://api.github.com/users/JimmyCYJ/repos","events_url":"https://api.github.com/users/JimmyCYJ/events{/privacy}","received_events_url":"https://api.github.com/users/JimmyCYJ/received_events","type":"User","site_admin":false},"html_url":"https://github.com/JimmyCYJ/istio","description":"An open platform to connect, manage, and secure microservices.","fork":true,"url":"https://api.github.com/repos/JimmyCYJ/istio","forks_url":"https://api.github.com/repos/JimmyCYJ/istio/forks","keys_url":"https://api.github.com/repos/JimmyCYJ/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JimmyCYJ/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JimmyCYJ/istio/teams","hooks_url":"https://api.github.com/repos/JimmyCYJ/istio/hooks","issue_events_url":"https://api.github.com/repos/JimmyCYJ/istio/issues/events{/number}","events_url":"https://api.github.com/repos/JimmyCYJ/istio/events","assignees_url":"https://api.github.com/repos/JimmyCYJ/istio/assignees{/user}","branches_url":"https://api.github.com/repos/JimmyCYJ/istio/branches{/branch}","tags_url":"https://api.github.com/repos/JimmyCYJ/istio/tags","blobs_url":"https://api.github.com/repos/JimmyCYJ/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JimmyCYJ/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JimmyCYJ/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/JimmyCYJ/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JimmyCYJ/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/JimmyCYJ/istio/languages","stargazers_url":"https://api.github.com/repos/JimmyCYJ/istio/stargazers","contributors_url":"https://api.github.com/repos/JimmyCYJ/istio/contributors","subscribers_url":"https://api.github.com/repos/JimmyCYJ/istio/subscribers","subscription_url":"https://api.github.com/repos/JimmyCYJ/istio/subscription","commits_url":"https://api.github.com/repos/JimmyCYJ/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/JimmyCYJ/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/JimmyCYJ/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/JimmyCYJ/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/JimmyCYJ/istio/contents/{+path}","compare_url":"https://api.github.com/repos/JimmyCYJ/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JimmyCYJ/istio/merges","archive_url":"https://api.github.com/repos/JimmyCYJ/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JimmyCYJ/istio/downloads","issues_url":"https://api.github.com/repos/JimmyCYJ/istio/issues{/number}","pulls_url":"https://api.github.com/repos/JimmyCYJ/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/JimmyCYJ/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/JimmyCYJ/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JimmyCYJ/istio/labels{/name}","releases_url":"https://api.github.com/repos/JimmyCYJ/istio/releases{/id}","deployments_url":"https://api.github.com/repos/JimmyCYJ/istio/deployments","created_at":"2018-05-25T00:26:23Z","updated_at":"2018-11-21T20:04:12Z","pushed_at":"2018-12-10T19:13:42Z","git_url":"git://github.com/JimmyCYJ/istio.git","ssh_url":"git@github.com:JimmyCYJ/istio.git","clone_url":"https://github.com/JimmyCYJ/istio.git","svn_url":"https://github.com/JimmyCYJ/istio","homepage":"https://istio.io","size":54236,"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":"istio:release-1.1","ref":"release-1.1","sha":"3298465c42e235be8e1d7d131e3c2c320ca539ee","user":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":74175805,"node_id":"MDEwOlJlcG9zaXRvcnk3NDE3NTgwNQ==","name":"istio","full_name":"istio/istio","private":false,"owner":{"login":"istio","id":23534644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0NjQ0","avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/istio/istio","description":"Connect, secure, control, and observe services.","fork":false,"url":"https://api.github.com/repos/istio/istio","forks_url":"https://api.github.com/repos/istio/istio/forks","keys_url":"https://api.github.com/repos/istio/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/istio/teams","hooks_url":"https://api.github.com/repos/istio/istio/hooks","issue_events_url":"https://api.github.com/repos/istio/istio/issues/events{/number}","events_url":"https://api.github.com/repos/istio/istio/events","assignees_url":"https://api.github.com/repos/istio/istio/assignees{/user}","branches_url":"https://api.github.com/repos/istio/istio/branches{/branch}","tags_url":"https://api.github.com/repos/istio/istio/tags","blobs_url":"https://api.github.com/repos/istio/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/istio/languages","stargazers_url":"https://api.github.com/repos/istio/istio/stargazers","contributors_url":"https://api.github.com/repos/istio/istio/contributors","subscribers_url":"https://api.github.com/repos/istio/istio/subscribers","subscription_url":"https://api.github.com/repos/istio/istio/subscription","commits_url":"https://api.github.com/repos/istio/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/istio/contents/{+path}","compare_url":"https://api.github.com/repos/istio/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/istio/merges","archive_url":"https://api.github.com/repos/istio/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/istio/downloads","issues_url":"https://api.github.com/repos/istio/istio/issues{/number}","pulls_url":"https://api.github.com/repos/istio/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/istio/labels{/name}","releases_url":"https://api.github.com/repos/istio/istio/releases{/id}","deployments_url":"https://api.github.com/repos/istio/istio/deployments","created_at":"2016-11-18T23:57:21Z","updated_at":"2018-12-11T00:32:23Z","pushed_at":"2018-12-11T00:32:05Z","git_url":"git://github.com/istio/istio.git","ssh_url":"git@github.com:istio/istio.git","clone_url":"https://github.com/istio/istio.git","svn_url":"https://github.com/istio/istio","homepage":"https://istio.io","size":55553,"stargazers_count":13696,"watchers_count":13696,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2105,"mirror_url":null,"archived":false,"open_issues_count":966,"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":2105,"open_issues":966,"watchers":13696,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/10327"},"html":{"href":"https://github.com/istio/istio/pull/10327"},"issue":{"href":"https://api.github.com/repos/istio/istio/issues/10327"},"comments":{"href":"https://api.github.com/repos/istio/istio/issues/10327/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/istio/pulls/10327/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/istio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/istio/pulls/10327/commits"},"statuses":{"href":"https://api.github.com/repos/istio/istio/statuses/7c58b8575b385cf9c333377309649ac6411215a7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"quanjielin"}}