{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/consul/pulls/comments/130195309","pull_request_review_id":53047568,"id":130195309,"diff_hunk":"@@ -2,49 +2,45 @@ package agent\n \n import (\n \t\"fmt\"\n+\t\"strings\"\n \t\"time\"\n+\n+\tdiscover \"github.com/hashicorp/go-discover\"\n )\n \n // RetryJoin is used to handle retrying a join until it succeeds or all\n // retries are exhausted.\n func (a *Agent) retryJoin() {\n \tcfg := a.config\n-\n-\tec2Enabled := cfg.RetryJoinEC2.TagKey != \"\" && cfg.RetryJoinEC2.TagValue != \"\"\n-\tgceEnabled := cfg.RetryJoinGCE.TagValue != \"\"\n-\tazureEnabled := cfg.RetryJoinAzure.TagName != \"\" && cfg.RetryJoinAzure.TagValue != \"\"\n-\n-\tif len(cfg.RetryJoin) == 0 && !ec2Enabled && !gceEnabled && !azureEnabled {\n+\tif len(cfg.RetryJoin) == 0 {\n \t\treturn\n \t}\n \n+\t// split retry join addresses from go-discover statements\n+\tvar addrs []string\n+\tvar disco string\n+\tfor _, addr := range cfg.RetryJoin {\n+\t\tif strings.Contains(addr, \"provider=\") {\n+\t\t\tdisco = addr","path":"agent/retry_join.go","position":29,"original_position":29,"commit_id":"8df7bce38b8c4dca7cbad9b4fcdf7fd074934192","original_commit_id":"8df7bce38b8c4dca7cbad9b4fcdf7fd074934192","user":{"login":"slackpad","id":673509,"avatar_url":"https://avatars0.githubusercontent.com/u/673509?v=4","gravatar_id":"","url":"https://api.github.com/users/slackpad","html_url":"https://github.com/slackpad","followers_url":"https://api.github.com/users/slackpad/followers","following_url":"https://api.github.com/users/slackpad/following{/other_user}","gists_url":"https://api.github.com/users/slackpad/gists{/gist_id}","starred_url":"https://api.github.com/users/slackpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slackpad/subscriptions","organizations_url":"https://api.github.com/users/slackpad/orgs","repos_url":"https://api.github.com/users/slackpad/repos","events_url":"https://api.github.com/users/slackpad/events{/privacy}","received_events_url":"https://api.github.com/users/slackpad/received_events","type":"User","site_admin":false},"body":"You could even call discover in here and append all the addresses to the address array, which is simpler.","created_at":"2017-07-28T22:01:30Z","updated_at":"2017-07-28T22:05:03Z","html_url":"https://github.com/hashicorp/consul/pull/3282#discussion_r130195309","pull_request_url":"https://api.github.com/repos/hashicorp/consul/pulls/3282","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/comments/130195309"},"html":{"href":"https://github.com/hashicorp/consul/pull/3282#discussion_r130195309"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3282"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/consul/pulls/3282","id":130730787,"html_url":"https://github.com/hashicorp/consul/pull/3282","diff_url":"https://github.com/hashicorp/consul/pull/3282.diff","patch_url":"https://github.com/hashicorp/consul/pull/3282.patch","issue_url":"https://api.github.com/repos/hashicorp/consul/issues/3282","number":3282,"state":"open","locked":false,"title":"Use go discover","user":{"login":"magiconair","id":229005,"avatar_url":"https://avatars3.githubusercontent.com/u/229005?v=4","gravatar_id":"","url":"https://api.github.com/users/magiconair","html_url":"https://github.com/magiconair","followers_url":"https://api.github.com/users/magiconair/followers","following_url":"https://api.github.com/users/magiconair/following{/other_user}","gists_url":"https://api.github.com/users/magiconair/gists{/gist_id}","starred_url":"https://api.github.com/users/magiconair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magiconair/subscriptions","organizations_url":"https://api.github.com/users/magiconair/orgs","repos_url":"https://api.github.com/users/magiconair/repos","events_url":"https://api.github.com/users/magiconair/events{/privacy}","received_events_url":"https://api.github.com/users/magiconair/received_events","type":"User","site_admin":false},"body":"not yet fully tested and `command/agent.go` needs some more work.","created_at":"2017-07-15T21:45:48Z","updated_at":"2017-07-28T22:05:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"732bfd465d2031f10dbeb86a258b29f973527ca6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"preetapan","id":460133,"avatar_url":"https://avatars1.githubusercontent.com/u/460133?v=4","gravatar_id":"","url":"https://api.github.com/users/preetapan","html_url":"https://github.com/preetapan","followers_url":"https://api.github.com/users/preetapan/followers","following_url":"https://api.github.com/users/preetapan/following{/other_user}","gists_url":"https://api.github.com/users/preetapan/gists{/gist_id}","starred_url":"https://api.github.com/users/preetapan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/preetapan/subscriptions","organizations_url":"https://api.github.com/users/preetapan/orgs","repos_url":"https://api.github.com/users/preetapan/repos","events_url":"https://api.github.com/users/preetapan/events{/privacy}","received_events_url":"https://api.github.com/users/preetapan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/consul/pulls/3282/commits","review_comments_url":"https://api.github.com/repos/hashicorp/consul/pulls/3282/comments","review_comment_url":"https://api.github.com/repos/hashicorp/consul/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/3282/comments","statuses_url":"https://api.github.com/repos/hashicorp/consul/statuses/8df7bce38b8c4dca7cbad9b4fcdf7fd074934192","head":{"label":"hashicorp:use-go-discover","ref":"use-go-discover","sha":"8df7bce38b8c4dca7cbad9b4fcdf7fd074934192","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":14125254,"name":"consul","full_name":"hashicorp/consul","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/consul","description":"Service Discovery and Configuration Made Easy","fork":false,"url":"https://api.github.com/repos/hashicorp/consul","forks_url":"https://api.github.com/repos/hashicorp/consul/forks","keys_url":"https://api.github.com/repos/hashicorp/consul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/consul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/consul/teams","hooks_url":"https://api.github.com/repos/hashicorp/consul/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/consul/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/consul/events","assignees_url":"https://api.github.com/repos/hashicorp/consul/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/consul/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/consul/tags","blobs_url":"https://api.github.com/repos/hashicorp/consul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/consul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/consul/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/consul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/consul/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/consul/languages","stargazers_url":"https://api.github.com/repos/hashicorp/consul/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/consul/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/consul/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/consul/subscription","commits_url":"https://api.github.com/repos/hashicorp/consul/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/consul/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/consul/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/consul/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/consul/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/consul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/consul/merges","archive_url":"https://api.github.com/repos/hashicorp/consul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/consul/downloads","issues_url":"https://api.github.com/repos/hashicorp/consul/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/consul/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/consul/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/consul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/consul/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/consul/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/consul/deployments","created_at":"2013-11-04T22:15:27Z","updated_at":"2017-07-28T10:22:00Z","pushed_at":"2017-07-28T21:57:31Z","git_url":"git://github.com/hashicorp/consul.git","ssh_url":"git@github.com:hashicorp/consul.git","clone_url":"https://github.com/hashicorp/consul.git","svn_url":"https://github.com/hashicorp/consul","homepage":"https://www.consul.io/","size":27211,"stargazers_count":9731,"watchers_count":9731,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1737,"mirror_url":null,"open_issues_count":332,"forks":1737,"open_issues":332,"watchers":9731,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"07ae7bc2e1607bf2eb38fd60af89da5b68408d81","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":14125254,"name":"consul","full_name":"hashicorp/consul","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/consul","description":"Service Discovery and Configuration Made Easy","fork":false,"url":"https://api.github.com/repos/hashicorp/consul","forks_url":"https://api.github.com/repos/hashicorp/consul/forks","keys_url":"https://api.github.com/repos/hashicorp/consul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/consul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/consul/teams","hooks_url":"https://api.github.com/repos/hashicorp/consul/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/consul/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/consul/events","assignees_url":"https://api.github.com/repos/hashicorp/consul/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/consul/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/consul/tags","blobs_url":"https://api.github.com/repos/hashicorp/consul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/consul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/consul/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/consul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/consul/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/consul/languages","stargazers_url":"https://api.github.com/repos/hashicorp/consul/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/consul/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/consul/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/consul/subscription","commits_url":"https://api.github.com/repos/hashicorp/consul/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/consul/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/consul/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/consul/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/consul/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/consul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/consul/merges","archive_url":"https://api.github.com/repos/hashicorp/consul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/consul/downloads","issues_url":"https://api.github.com/repos/hashicorp/consul/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/consul/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/consul/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/consul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/consul/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/consul/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/consul/deployments","created_at":"2013-11-04T22:15:27Z","updated_at":"2017-07-28T10:22:00Z","pushed_at":"2017-07-28T21:57:31Z","git_url":"git://github.com/hashicorp/consul.git","ssh_url":"git@github.com:hashicorp/consul.git","clone_url":"https://github.com/hashicorp/consul.git","svn_url":"https://github.com/hashicorp/consul","homepage":"https://www.consul.io/","size":27211,"stargazers_count":9731,"watchers_count":9731,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1737,"mirror_url":null,"open_issues_count":332,"forks":1737,"open_issues":332,"watchers":9731,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3282"},"html":{"href":"https://github.com/hashicorp/consul/pull/3282"},"issue":{"href":"https://api.github.com/repos/hashicorp/consul/issues/3282"},"comments":{"href":"https://api.github.com/repos/hashicorp/consul/issues/3282/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3282/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/consul/pulls/3282/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/consul/statuses/8df7bce38b8c4dca7cbad9b4fcdf7fd074934192"}}}}
{"actor":{"display_login":"slackpad"}}