{"action":"created","issue":{"url":"https://api.github.com/repos/istio/istio/issues/4841","repository_url":"https://api.github.com/repos/istio/istio","labels_url":"https://api.github.com/repos/istio/istio/issues/4841/labels{/name}","comments_url":"https://api.github.com/repos/istio/istio/issues/4841/comments","events_url":"https://api.github.com/repos/istio/istio/issues/4841/events","html_url":"https://github.com/istio/istio/issues/4841","id":312905296,"number":4841,"title":"The customConfigFile and proxy.v2 flags condition is not clear","user":{"login":"crystaldust","id":2040659,"avatar_url":"https://avatars2.githubusercontent.com/u/2040659?v=4","gravatar_id":"","url":"https://api.github.com/users/crystaldust","html_url":"https://github.com/crystaldust","followers_url":"https://api.github.com/users/crystaldust/followers","following_url":"https://api.github.com/users/crystaldust/following{/other_user}","gists_url":"https://api.github.com/users/crystaldust/gists{/gist_id}","starred_url":"https://api.github.com/users/crystaldust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystaldust/subscriptions","organizations_url":"https://api.github.com/users/crystaldust/orgs","repos_url":"https://api.github.com/users/crystaldust/repos","events_url":"https://api.github.com/users/crystaldust/events{/privacy}","received_events_url":"https://api.github.com/users/crystaldust/received_events","type":"User","site_admin":false},"labels":[{"id":735781806,"url":"https://api.github.com/repos/istio/istio/labels/area/networking","name":"area/networking","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":{"login":"costinm","id":84202,"avatar_url":"https://avatars1.githubusercontent.com/u/84202?v=4","gravatar_id":"","url":"https://api.github.com/users/costinm","html_url":"https://github.com/costinm","followers_url":"https://api.github.com/users/costinm/followers","following_url":"https://api.github.com/users/costinm/following{/other_user}","gists_url":"https://api.github.com/users/costinm/gists{/gist_id}","starred_url":"https://api.github.com/users/costinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costinm/subscriptions","organizations_url":"https://api.github.com/users/costinm/orgs","repos_url":"https://api.github.com/users/costinm/repos","events_url":"https://api.github.com/users/costinm/events{/privacy}","received_events_url":"https://api.github.com/users/costinm/received_events","type":"User","site_admin":false},"assignees":[{"login":"costinm","id":84202,"avatar_url":"https://avatars1.githubusercontent.com/u/84202?v=4","gravatar_id":"","url":"https://api.github.com/users/costinm","html_url":"https://github.com/costinm","followers_url":"https://api.github.com/users/costinm/followers","following_url":"https://api.github.com/users/costinm/following{/other_user}","gists_url":"https://api.github.com/users/costinm/gists{/gist_id}","starred_url":"https://api.github.com/users/costinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costinm/subscriptions","organizations_url":"https://api.github.com/users/costinm/orgs","repos_url":"https://api.github.com/users/costinm/repos","events_url":"https://api.github.com/users/costinm/events{/privacy}","received_events_url":"https://api.github.com/users/costinm/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-04-10T12:42:03Z","updated_at":"2018-04-11T17:07:44Z","closed_at":null,"author_association":"NONE","body":"The code is here:\r\nhttps://github.com/istio/istio/blob/cc84e301acc1fbf101349085a6b3b5098958f891/pilot/pkg/proxy/envoy/v1/watcher.go#L356\r\n\r\nWhen `CustomConfigFile` is specified, then the `bootstrap.WriteBootstrap` logic(under `else if proxy.v2` branch) will never be reached. But within the `bootstrap.WriteBootstrap` logic, the `CustomConfigFile` arg is also used as conditions, it's used as the custom config template file path. So this part of logic will never be reached.\r\n\r\nBy the current logic with 3 if branches:\r\n- branch1: **CustomConfigFile** is not empty => take the file specified by CustomConfigFile as envoy config file\r\n- branch2: **CustomConfigFile** is empty and proxy.v2 is true => Since `CustomConfigFile` is empty,  the default template file `/var/lib/istio/envoy/envoy_bootstrap_tmpl.json` will be applied. **We can't specify our custom template file, unless we use env var 'ISTIO_BOOTSTRAP'**\r\n- branch3: **CustomConfigFile** is empty and proxy.v2 is false => Write config to '/etc/istio/proxy/rev-0.json' and take it as envoy config file\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/istio/istio/issues/comments/380526506","html_url":"https://github.com/istio/istio/issues/4841#issuecomment-380526506","issue_url":"https://api.github.com/repos/istio/istio/issues/4841","id":380526506,"user":{"login":"costinm","id":84202,"avatar_url":"https://avatars1.githubusercontent.com/u/84202?v=4","gravatar_id":"","url":"https://api.github.com/users/costinm","html_url":"https://github.com/costinm","followers_url":"https://api.github.com/users/costinm/followers","following_url":"https://api.github.com/users/costinm/following{/other_user}","gists_url":"https://api.github.com/users/costinm/gists{/gist_id}","starred_url":"https://api.github.com/users/costinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costinm/subscriptions","organizations_url":"https://api.github.com/users/costinm/orgs","repos_url":"https://api.github.com/users/costinm/repos","events_url":"https://api.github.com/users/costinm/events{/privacy}","received_events_url":"https://api.github.com/users/costinm/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T17:07:44Z","updated_at":"2018-04-11T17:07:44Z","author_association":"CONTRIBUTOR","body":"In other words: branch 1 and 3 are for deprecated / likely dead code. Not removing it yet - post 0.8.\r\n\r\nBranch 2 is the one that should be alive - with the env variable to override. "}}
{"actor":{"display_login":"costinm"}}