{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/70154240","id":70154240,"diff_hunk":"@@ -684,27 +684,31 @@ func (c *Syncer) registerCheck(chkReg *consul.AgentCheckRegistration) error {\n \n // createCheckReg creates a Check that can be registered with Nomad. It also\n // creates a Nomad check for the check types that it can handle.\n-func (c *Syncer) createCheckReg(check *structs.ServiceCheck, service *consul.AgentServiceRegistration) (*consul.AgentCheckRegistration, error) {\n+func (c *Syncer) createCheckReg(check *structs.ServiceCheck, serviceReg *consul.AgentServiceRegistration) (*consul.AgentCheckRegistration, error) {\n \tchkReg := consul.AgentCheckRegistration{\n-\t\tID:        check.Hash(service.ID),\n+\t\tID:        check.Hash(serviceReg.ID),\n \t\tName:      check.Name,\n-\t\tServiceID: service.ID,\n+\t\tServiceID: serviceReg.ID,\n \t}\n \tchkReg.Timeout = check.Timeout.String()\n \tchkReg.Interval = check.Interval.String()\n+\thost, port := serviceReg.Address, serviceReg.Port\n+\tif check.PortLabel != \"\" {\n+\t\thost, port = c.addrFinder(check.PortLabel)\n+\t}\n \tswitch check.Type {\n \tcase structs.ServiceCheckHTTP:\n \t\tif check.Protocol == \"\" {\n \t\t\tcheck.Protocol = \"http\"\n \t\t}\n \t\turl := url.URL{\n \t\t\tScheme: check.Protocol,\n-\t\t\tHost:   fmt.Sprintf(\"%s:%d\", service.Address, service.Port),\n+\t\t\tHost:   fmt.Sprintf(\"%s:%d\", host, port),\n \t\t\tPath:   check.Path,\n \t\t}\n \t\tchkReg.HTTP = url.String()\n \tcase structs.ServiceCheckTCP:\n-\t\tchkReg.TCP = fmt.Sprintf(\"%s:%d\", service.Address, service.Port)\n+\t\tchkReg.TCP = fmt.Sprintf(\"%s:%d\", host, port)","path":"command/agent/consul/syncer.go","position":33,"original_position":33,"commit_id":"6cb5fd369414872feb64f96c29c4f7ec37972617","original_commit_id":"6cb5fd369414872feb64f96c29c4f7ec37972617","user":{"login":"sean-","id":349516,"avatar_url":"https://avatars.githubusercontent.com/u/349516?v=3","gravatar_id":"","url":"https://api.github.com/users/sean-","html_url":"https://github.com/sean-","followers_url":"https://api.github.com/users/sean-/followers","following_url":"https://api.github.com/users/sean-/following{/other_user}","gists_url":"https://api.github.com/users/sean-/gists{/gist_id}","starred_url":"https://api.github.com/users/sean-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sean-/subscriptions","organizations_url":"https://api.github.com/users/sean-/orgs","repos_url":"https://api.github.com/users/sean-/repos","events_url":"https://api.github.com/users/sean-/events{/privacy}","received_events_url":"https://api.github.com/users/sean-/received_events","type":"User","site_admin":false},"body":"Ditto.","created_at":"2016-07-08T23:19:17Z","updated_at":"2016-07-08T23:19:17Z","html_url":"https://github.com/hashicorp/nomad/pull/1395#discussion_r70154240","pull_request_url":"https://api.github.com/repos/hashicorp/nomad/pulls/1395","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments/70154240"},"html":{"href":"https://github.com/hashicorp/nomad/pull/1395#discussion_r70154240"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/1395"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/nomad/pulls/1395","id":76814956,"html_url":"https://github.com/hashicorp/nomad/pull/1395","diff_url":"https://github.com/hashicorp/nomad/pull/1395.diff","patch_url":"https://github.com/hashicorp/nomad/pull/1395.patch","issue_url":"https://api.github.com/repos/hashicorp/nomad/issues/1395","number":1395,"state":"open","locked":false,"title":"Allowing ports to be overriden in check definitions","user":{"login":"diptanu","id":21833,"avatar_url":"https://avatars.githubusercontent.com/u/21833?v=3","gravatar_id":"","url":"https://api.github.com/users/diptanu","html_url":"https://github.com/diptanu","followers_url":"https://api.github.com/users/diptanu/followers","following_url":"https://api.github.com/users/diptanu/following{/other_user}","gists_url":"https://api.github.com/users/diptanu/gists{/gist_id}","starred_url":"https://api.github.com/users/diptanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diptanu/subscriptions","organizations_url":"https://api.github.com/users/diptanu/orgs","repos_url":"https://api.github.com/users/diptanu/repos","events_url":"https://api.github.com/users/diptanu/events{/privacy}","received_events_url":"https://api.github.com/users/diptanu/received_events","type":"User","site_admin":false},"body":"Fixes #1216 ","created_at":"2016-07-08T21:10:33Z","updated_at":"2016-07-08T23:19:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42de7fd2cfdbb7e9fe18bce12682b0c8ec6ae6b9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/nomad/pulls/1395/commits","review_comments_url":"https://api.github.com/repos/hashicorp/nomad/pulls/1395/comments","review_comment_url":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/nomad/issues/1395/comments","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/6cb5fd369414872feb64f96c29c4f7ec37972617","head":{"label":"hashicorp:f-check-port","ref":"f-check-port","sha":"6cb5fd369414872feb64f96c29c4f7ec37972617","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","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":36653430,"name":"nomad","full_name":"hashicorp/nomad","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","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/nomad","description":"A Distributed, Highly Available, Datacenter-Aware Scheduler","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2016-07-08T16:10:22Z","pushed_at":"2016-07-08T22:38:21Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":26004,"stargazers_count":1694,"watchers_count":1694,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":249,"mirror_url":null,"open_issues_count":139,"forks":249,"open_issues":139,"watchers":1694,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"ac475519d108f4ead18d7253632bd2c8156cf088","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","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":36653430,"name":"nomad","full_name":"hashicorp/nomad","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","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/nomad","description":"A Distributed, Highly Available, Datacenter-Aware Scheduler","fork":false,"url":"https://api.github.com/repos/hashicorp/nomad","forks_url":"https://api.github.com/repos/hashicorp/nomad/forks","keys_url":"https://api.github.com/repos/hashicorp/nomad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/nomad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/nomad/teams","hooks_url":"https://api.github.com/repos/hashicorp/nomad/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/nomad/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/nomad/events","assignees_url":"https://api.github.com/repos/hashicorp/nomad/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/nomad/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/nomad/tags","blobs_url":"https://api.github.com/repos/hashicorp/nomad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/nomad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/nomad/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/nomad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/nomad/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/nomad/languages","stargazers_url":"https://api.github.com/repos/hashicorp/nomad/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/nomad/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/nomad/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/nomad/subscription","commits_url":"https://api.github.com/repos/hashicorp/nomad/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/nomad/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/nomad/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/nomad/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/nomad/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/nomad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/nomad/merges","archive_url":"https://api.github.com/repos/hashicorp/nomad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/nomad/downloads","issues_url":"https://api.github.com/repos/hashicorp/nomad/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/nomad/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/nomad/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/nomad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/nomad/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/nomad/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/nomad/deployments","created_at":"2015-06-01T10:21:00Z","updated_at":"2016-07-08T16:10:22Z","pushed_at":"2016-07-08T22:38:21Z","git_url":"git://github.com/hashicorp/nomad.git","ssh_url":"git@github.com:hashicorp/nomad.git","clone_url":"https://github.com/hashicorp/nomad.git","svn_url":"https://github.com/hashicorp/nomad","homepage":"https://www.nomadproject.io/","size":26004,"stargazers_count":1694,"watchers_count":1694,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":249,"mirror_url":null,"open_issues_count":139,"forks":249,"open_issues":139,"watchers":1694,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/1395"},"html":{"href":"https://github.com/hashicorp/nomad/pull/1395"},"issue":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/1395"},"comments":{"href":"https://api.github.com/repos/hashicorp/nomad/issues/1395/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/1395/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/nomad/pulls/1395/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/nomad/statuses/6cb5fd369414872feb64f96c29c4f7ec37972617"}}}}
{"actor":{"display_login":"sean-"}}