{"action":"created","comment":{"url":"https://api.github.com/repos/emilevauge/traefik/pulls/comments/47339653","id":47339653,"diff_hunk":"@@ -179,7 +179,15 @@ func (provider *Marathon) getLabel(application marathon.Application, label strin\n \treturn \"\", errors.New(\"Label not found:\" + label)\n }\n \n-func (provider *Marathon) getPort(task marathon.Task) string {\n+func (provider *Marathon) getPort(task marathon.Task, applications []marathon.Application) string {\n+\tapplication, errApp := getApplication(task, applications)\n+\tif errApp != nil {\n+\t\tlog.Errorf(\"Unable to get marathon application from task %s\", task.AppID)\n+\t\treturn \"\"\n+\t}\n+\tif label, err := provider.getLabel(application, \"traefik.port\"); err == nil {\n+\t\treturn label","path":"provider/marathon.go","position":12,"original_position":12,"commit_id":"94b88a410e5ed0f3042b3c6b422b5284c8a94bea","original_commit_id":"94b88a410e5ed0f3042b3c6b422b5284c8a94bea","user":{"login":"emilevauge","id":6207234,"avatar_url":"https://avatars.githubusercontent.com/u/6207234?v=3","gravatar_id":"","url":"https://api.github.com/users/emilevauge","html_url":"https://github.com/emilevauge","followers_url":"https://api.github.com/users/emilevauge/followers","following_url":"https://api.github.com/users/emilevauge/following{/other_user}","gists_url":"https://api.github.com/users/emilevauge/gists{/gist_id}","starred_url":"https://api.github.com/users/emilevauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilevauge/subscriptions","organizations_url":"https://api.github.com/users/emilevauge/orgs","repos_url":"https://api.github.com/users/emilevauge/repos","events_url":"https://api.github.com/users/emilevauge/events{/privacy}","received_events_url":"https://api.github.com/users/emilevauge/received_events","type":"User","site_admin":false},"body":"I'm not sure another label is needed. if we create `traefik.portIndex`, `traefik.port` will never be used. What do you think about that? We keep `traefik.port` in Marathon and use it as an index, or drop `traefik.port` and create a new label for that? cc @vdemeester ","created_at":"2015-12-11T10:16:36Z","updated_at":"2015-12-11T10:16:36Z","html_url":"https://github.com/emilevauge/traefik/pull/138#discussion_r47339653","pull_request_url":"https://api.github.com/repos/emilevauge/traefik/pulls/138","_links":{"self":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/comments/47339653"},"html":{"href":"https://github.com/emilevauge/traefik/pull/138#discussion_r47339653"},"pull_request":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/138"}}},"pull_request":{"url":"https://api.github.com/repos/emilevauge/traefik/pulls/138","id":52761829,"html_url":"https://github.com/emilevauge/traefik/pull/138","diff_url":"https://github.com/emilevauge/traefik/pull/138.diff","patch_url":"https://github.com/emilevauge/traefik/pull/138.patch","issue_url":"https://api.github.com/repos/emilevauge/traefik/issues/138","number":138,"state":"open","locked":false,"title":"Marathon provider uses port from label.","user":{"login":"dylanmei","id":109874,"avatar_url":"https://avatars.githubusercontent.com/u/109874?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmei","html_url":"https://github.com/dylanmei","followers_url":"https://api.github.com/users/dylanmei/followers","following_url":"https://api.github.com/users/dylanmei/following{/other_user}","gists_url":"https://api.github.com/users/dylanmei/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmei/subscriptions","organizations_url":"https://api.github.com/users/dylanmei/orgs","repos_url":"https://api.github.com/users/dylanmei/repos","events_url":"https://api.github.com/users/dylanmei/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmei/received_events","type":"User","site_admin":false},"body":"The \"traefik.port\" label value is not used when selecting which port to use. Instead, the Marathon provider always uses the first possible port.\r\n\r\nThe Marathon provider should honor the \"traefik.port\" label supplied by the Marathon app.  If no \"traefik.port\" label is specified, then the first possible port us used.\r\n","created_at":"2015-12-05T19:04:06Z","updated_at":"2015-12-11T10:16:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f8a57ae30e4d93de91faee27a433f2de6025b1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emilevauge/traefik/pulls/138/commits","review_comments_url":"https://api.github.com/repos/emilevauge/traefik/pulls/138/comments","review_comment_url":"https://api.github.com/repos/emilevauge/traefik/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emilevauge/traefik/issues/138/comments","statuses_url":"https://api.github.com/repos/emilevauge/traefik/statuses/94b88a410e5ed0f3042b3c6b422b5284c8a94bea","head":{"label":"dylanmei:marathon_uses_port_from_label","ref":"marathon_uses_port_from_label","sha":"94b88a410e5ed0f3042b3c6b422b5284c8a94bea","user":{"login":"dylanmei","id":109874,"avatar_url":"https://avatars.githubusercontent.com/u/109874?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmei","html_url":"https://github.com/dylanmei","followers_url":"https://api.github.com/users/dylanmei/followers","following_url":"https://api.github.com/users/dylanmei/following{/other_user}","gists_url":"https://api.github.com/users/dylanmei/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmei/subscriptions","organizations_url":"https://api.github.com/users/dylanmei/orgs","repos_url":"https://api.github.com/users/dylanmei/repos","events_url":"https://api.github.com/users/dylanmei/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmei/received_events","type":"User","site_admin":false},"repo":{"id":47466351,"name":"traefik","full_name":"dylanmei/traefik","owner":{"login":"dylanmei","id":109874,"avatar_url":"https://avatars.githubusercontent.com/u/109874?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmei","html_url":"https://github.com/dylanmei","followers_url":"https://api.github.com/users/dylanmei/followers","following_url":"https://api.github.com/users/dylanmei/following{/other_user}","gists_url":"https://api.github.com/users/dylanmei/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmei/subscriptions","organizations_url":"https://api.github.com/users/dylanmei/orgs","repos_url":"https://api.github.com/users/dylanmei/repos","events_url":"https://api.github.com/users/dylanmei/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dylanmei/traefik","description":"Træfɪk, a modern reverse proxy","fork":true,"url":"https://api.github.com/repos/dylanmei/traefik","forks_url":"https://api.github.com/repos/dylanmei/traefik/forks","keys_url":"https://api.github.com/repos/dylanmei/traefik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dylanmei/traefik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dylanmei/traefik/teams","hooks_url":"https://api.github.com/repos/dylanmei/traefik/hooks","issue_events_url":"https://api.github.com/repos/dylanmei/traefik/issues/events{/number}","events_url":"https://api.github.com/repos/dylanmei/traefik/events","assignees_url":"https://api.github.com/repos/dylanmei/traefik/assignees{/user}","branches_url":"https://api.github.com/repos/dylanmei/traefik/branches{/branch}","tags_url":"https://api.github.com/repos/dylanmei/traefik/tags","blobs_url":"https://api.github.com/repos/dylanmei/traefik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dylanmei/traefik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dylanmei/traefik/git/refs{/sha}","trees_url":"https://api.github.com/repos/dylanmei/traefik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dylanmei/traefik/statuses/{sha}","languages_url":"https://api.github.com/repos/dylanmei/traefik/languages","stargazers_url":"https://api.github.com/repos/dylanmei/traefik/stargazers","contributors_url":"https://api.github.com/repos/dylanmei/traefik/contributors","subscribers_url":"https://api.github.com/repos/dylanmei/traefik/subscribers","subscription_url":"https://api.github.com/repos/dylanmei/traefik/subscription","commits_url":"https://api.github.com/repos/dylanmei/traefik/commits{/sha}","git_commits_url":"https://api.github.com/repos/dylanmei/traefik/git/commits{/sha}","comments_url":"https://api.github.com/repos/dylanmei/traefik/comments{/number}","issue_comment_url":"https://api.github.com/repos/dylanmei/traefik/issues/comments{/number}","contents_url":"https://api.github.com/repos/dylanmei/traefik/contents/{+path}","compare_url":"https://api.github.com/repos/dylanmei/traefik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dylanmei/traefik/merges","archive_url":"https://api.github.com/repos/dylanmei/traefik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dylanmei/traefik/downloads","issues_url":"https://api.github.com/repos/dylanmei/traefik/issues{/number}","pulls_url":"https://api.github.com/repos/dylanmei/traefik/pulls{/number}","milestones_url":"https://api.github.com/repos/dylanmei/traefik/milestones{/number}","notifications_url":"https://api.github.com/repos/dylanmei/traefik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dylanmei/traefik/labels{/name}","releases_url":"https://api.github.com/repos/dylanmei/traefik/releases{/id}","created_at":"2015-12-05T17:53:05Z","updated_at":"2015-12-05T17:53:06Z","pushed_at":"2015-12-05T18:59:19Z","git_url":"git://github.com/dylanmei/traefik.git","ssh_url":"git@github.com:dylanmei/traefik.git","clone_url":"https://github.com/dylanmei/traefik.git","svn_url":"https://github.com/dylanmei/traefik","homepage":"http://traefik.io/","size":2193,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"emilevauge:master","ref":"master","sha":"f955cc33c5b9e220d3112944530493759be576d9","user":{"login":"emilevauge","id":6207234,"avatar_url":"https://avatars.githubusercontent.com/u/6207234?v=3","gravatar_id":"","url":"https://api.github.com/users/emilevauge","html_url":"https://github.com/emilevauge","followers_url":"https://api.github.com/users/emilevauge/followers","following_url":"https://api.github.com/users/emilevauge/following{/other_user}","gists_url":"https://api.github.com/users/emilevauge/gists{/gist_id}","starred_url":"https://api.github.com/users/emilevauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilevauge/subscriptions","organizations_url":"https://api.github.com/users/emilevauge/orgs","repos_url":"https://api.github.com/users/emilevauge/repos","events_url":"https://api.github.com/users/emilevauge/events{/privacy}","received_events_url":"https://api.github.com/users/emilevauge/received_events","type":"User","site_admin":false},"repo":{"id":42408804,"name":"traefik","full_name":"emilevauge/traefik","owner":{"login":"emilevauge","id":6207234,"avatar_url":"https://avatars.githubusercontent.com/u/6207234?v=3","gravatar_id":"","url":"https://api.github.com/users/emilevauge","html_url":"https://github.com/emilevauge","followers_url":"https://api.github.com/users/emilevauge/followers","following_url":"https://api.github.com/users/emilevauge/following{/other_user}","gists_url":"https://api.github.com/users/emilevauge/gists{/gist_id}","starred_url":"https://api.github.com/users/emilevauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilevauge/subscriptions","organizations_url":"https://api.github.com/users/emilevauge/orgs","repos_url":"https://api.github.com/users/emilevauge/repos","events_url":"https://api.github.com/users/emilevauge/events{/privacy}","received_events_url":"https://api.github.com/users/emilevauge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emilevauge/traefik","description":"Træfɪk, a modern reverse proxy","fork":false,"url":"https://api.github.com/repos/emilevauge/traefik","forks_url":"https://api.github.com/repos/emilevauge/traefik/forks","keys_url":"https://api.github.com/repos/emilevauge/traefik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emilevauge/traefik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emilevauge/traefik/teams","hooks_url":"https://api.github.com/repos/emilevauge/traefik/hooks","issue_events_url":"https://api.github.com/repos/emilevauge/traefik/issues/events{/number}","events_url":"https://api.github.com/repos/emilevauge/traefik/events","assignees_url":"https://api.github.com/repos/emilevauge/traefik/assignees{/user}","branches_url":"https://api.github.com/repos/emilevauge/traefik/branches{/branch}","tags_url":"https://api.github.com/repos/emilevauge/traefik/tags","blobs_url":"https://api.github.com/repos/emilevauge/traefik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emilevauge/traefik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emilevauge/traefik/git/refs{/sha}","trees_url":"https://api.github.com/repos/emilevauge/traefik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emilevauge/traefik/statuses/{sha}","languages_url":"https://api.github.com/repos/emilevauge/traefik/languages","stargazers_url":"https://api.github.com/repos/emilevauge/traefik/stargazers","contributors_url":"https://api.github.com/repos/emilevauge/traefik/contributors","subscribers_url":"https://api.github.com/repos/emilevauge/traefik/subscribers","subscription_url":"https://api.github.com/repos/emilevauge/traefik/subscription","commits_url":"https://api.github.com/repos/emilevauge/traefik/commits{/sha}","git_commits_url":"https://api.github.com/repos/emilevauge/traefik/git/commits{/sha}","comments_url":"https://api.github.com/repos/emilevauge/traefik/comments{/number}","issue_comment_url":"https://api.github.com/repos/emilevauge/traefik/issues/comments{/number}","contents_url":"https://api.github.com/repos/emilevauge/traefik/contents/{+path}","compare_url":"https://api.github.com/repos/emilevauge/traefik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emilevauge/traefik/merges","archive_url":"https://api.github.com/repos/emilevauge/traefik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emilevauge/traefik/downloads","issues_url":"https://api.github.com/repos/emilevauge/traefik/issues{/number}","pulls_url":"https://api.github.com/repos/emilevauge/traefik/pulls{/number}","milestones_url":"https://api.github.com/repos/emilevauge/traefik/milestones{/number}","notifications_url":"https://api.github.com/repos/emilevauge/traefik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emilevauge/traefik/labels{/name}","releases_url":"https://api.github.com/repos/emilevauge/traefik/releases{/id}","created_at":"2015-09-13T19:04:02Z","updated_at":"2015-12-11T09:17:26Z","pushed_at":"2015-12-07T21:21:32Z","git_url":"git://github.com/emilevauge/traefik.git","ssh_url":"git@github.com:emilevauge/traefik.git","clone_url":"https://github.com/emilevauge/traefik.git","svn_url":"https://github.com/emilevauge/traefik","homepage":"http://traefik.io/","size":2334,"stargazers_count":1267,"watchers_count":1267,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":33,"forks":50,"open_issues":33,"watchers":1267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/138"},"html":{"href":"https://github.com/emilevauge/traefik/pull/138"},"issue":{"href":"https://api.github.com/repos/emilevauge/traefik/issues/138"},"comments":{"href":"https://api.github.com/repos/emilevauge/traefik/issues/138/comments"},"review_comments":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/138/comments"},"review_comment":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emilevauge/traefik/pulls/138/commits"},"statuses":{"href":"https://api.github.com/repos/emilevauge/traefik/statuses/94b88a410e5ed0f3042b3c6b422b5284c8a94bea"}}}}