{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul/issues/6930","repository_url":"https://api.github.com/repos/hashicorp/consul","labels_url":"https://api.github.com/repos/hashicorp/consul/issues/6930/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/6930/comments","events_url":"https://api.github.com/repos/hashicorp/consul/issues/6930/events","html_url":"https://github.com/hashicorp/consul/issues/6930","id":536071955,"node_id":"MDU6SXNzdWU1MzYwNzE5NTU=","number":6930,"title":"(Minor) consul watch ignores HTTP API Options on command line","user":{"login":"aramg","id":1758094,"node_id":"MDQ6VXNlcjE3NTgwOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1758094?v=4","gravatar_id":"","url":"https://api.github.com/users/aramg","html_url":"https://github.com/aramg","followers_url":"https://api.github.com/users/aramg/followers","following_url":"https://api.github.com/users/aramg/following{/other_user}","gists_url":"https://api.github.com/users/aramg/gists{/gist_id}","starred_url":"https://api.github.com/users/aramg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aramg/subscriptions","organizations_url":"https://api.github.com/users/aramg/orgs","repos_url":"https://api.github.com/users/aramg/repos","events_url":"https://api.github.com/users/aramg/events{/privacy}","received_events_url":"https://api.github.com/users/aramg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-12-11T00:31:25Z","updated_at":"2019-12-11T02:39:58Z","closed_at":null,"author_association":"NONE","body":"#### Overview of the Issue\r\n\r\n`consul watch` command doesn't pass down HTTP flags (args) down to watch plan.\r\n\r\nhttps://github.com/hashicorp/consul/blob/master/command/watch/watch.go#L252 passes a nil config down which causes the watch plan to re-create a NewClient with mostly default options, while the HTTP options from https://github.com/hashicorp/consul/blob/master/command/watch/watch.go#L162 get discarded.\r\n\r\nUsing environment variables for the HTTP options still works since the new re-created Client in plan.go will parse those upon creation.\r\n\r\n#### Reproduction Steps\r\n\r\nRun consul with a self signed certificate and a custom CA file.\r\n\r\n```\r\n~# consul watch -http-addr https://consul-server-addr:8443  -type nodes\r\nError querying Consul agent: Get https://consul-server-addr:8443/v1/agent/self: x509: certificate signed by unknown authority\r\n\r\n~# consul watch -ca-file /etc/consul.d/ca.crt  -http-addr https://consul-server-addr:8443  -type nodes\r\n2019/12/11 00:16:14 [ERR] consul.watch: Watch (type: nodes) errored: Get https://consul-server-addr:8443/v1/catalog/nodes: x509: certificate signed by unknown authority, retry in 5s\r\n^C\r\n\r\n~# env CONSUL_CACERT=/etc/consul.d/ca.crt consul watch  -http-addr https://consul-server-addr:8443  -type nodes\r\n[\r\n    {\r\n        \"ID\": \"f75216c7-d78a-5757-xxxx-346e0a4b64b8\",\r\n...\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/consul/issues/comments/564351416","html_url":"https://github.com/hashicorp/consul/issues/6930#issuecomment-564351416","issue_url":"https://api.github.com/repos/hashicorp/consul/issues/6930","id":564351416,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NDM1MTQxNg==","user":{"login":"aramg","id":1758094,"node_id":"MDQ6VXNlcjE3NTgwOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1758094?v=4","gravatar_id":"","url":"https://api.github.com/users/aramg","html_url":"https://github.com/aramg","followers_url":"https://api.github.com/users/aramg/followers","following_url":"https://api.github.com/users/aramg/following{/other_user}","gists_url":"https://api.github.com/users/aramg/gists{/gist_id}","starred_url":"https://api.github.com/users/aramg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aramg/subscriptions","organizations_url":"https://api.github.com/users/aramg/orgs","repos_url":"https://api.github.com/users/aramg/repos","events_url":"https://api.github.com/users/aramg/events{/privacy}","received_events_url":"https://api.github.com/users/aramg/received_events","type":"User","site_admin":false},"created_at":"2019-12-11T02:39:58Z","updated_at":"2019-12-11T02:39:58Z","author_association":"NONE","body":"Potential fix: https://github.com/hashicorp/consul/compare/master...aramg:cmd-watch-config-bug?expand=1"}}
{"actor":{"display_login":"aramg"}}