{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/58001126","id":58001126,"diff_hunk":"@@ -457,10 +464,17 @@ func RunCmdRouter(f *clientcmd.Factory, cmd *cobra.Command, out io.Writer, cfg *\n \t\treturn fmt.Errorf(\"unable to parse --ports: %v\", err)\n \t}\n \n-\t// For the host networking case, ensure the ports match. Otherwise, remove host ports\n-\tfor i := 0; i < len(ports); i++ {\n-\t\tif cfg.HostNetwork && ports[i].HostPort != 0 && ports[i].ContainerPort != ports[i].HostPort {\n-\t\t\treturn fmt.Errorf(\"when using host networking mode, container port %d and host port %d must be equal\", ports[i].ContainerPort, ports[i].HostPort)\n+\t// HostNetwork overrides HostPorts\n+\tif cfg.HostNetwork {\n+\t\tcfg.HostPorts = false","path":"pkg/cmd/admin/router/router.go","position":81,"original_position":81,"commit_id":"1fd121b487f37d90f41daca4fe6d3cd9b51896c6","original_commit_id":"1fd121b487f37d90f41daca4fe6d3cd9b51896c6","user":{"login":"liggitt","id":980082,"avatar_url":"https://avatars.githubusercontent.com/u/980082?v=3","gravatar_id":"","url":"https://api.github.com/users/liggitt","html_url":"https://github.com/liggitt","followers_url":"https://api.github.com/users/liggitt/followers","following_url":"https://api.github.com/users/liggitt/following{/other_user}","gists_url":"https://api.github.com/users/liggitt/gists{/gist_id}","starred_url":"https://api.github.com/users/liggitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liggitt/subscriptions","organizations_url":"https://api.github.com/users/liggitt/orgs","repos_url":"https://api.github.com/users/liggitt/repos","events_url":"https://api.github.com/users/liggitt/events{/privacy}","received_events_url":"https://api.github.com/users/liggitt/received_events","type":"User","site_admin":false},"body":"unfortunate we can't tell here if the user explicitly passed `--host-network --host-ports` (which should probably be a validation error?) or if we're just adjusting the default","created_at":"2016-03-31T04:52:57Z","updated_at":"2016-03-31T04:52:57Z","html_url":"https://github.com/openshift/origin/pull/8300#discussion_r58001126","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/8300","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/58001126"},"html":{"href":"https://github.com/openshift/origin/pull/8300#discussion_r58001126"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/8300"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/8300","id":64655396,"html_url":"https://github.com/openshift/origin/pull/8300","diff_url":"https://github.com/openshift/origin/pull/8300.diff","patch_url":"https://github.com/openshift/origin/pull/8300.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/8300","number":8300,"state":"open","locked":false,"title":"The router command should keep support for hostPort","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"Add a new `--host-ports=false` flag for people who don't want host port.\r\nRestore the old functionality of setting hostPorts when\r\n`--host-network=false`. Allow `--ports` to apply to hostPort AND the service\r\nmappings (so user sees consistent ports on service port and hosts).\r\n`--host-ports` defaults to true, but `--host-network` has priority.\r\n\r\nIf specifying `-o yaml` and SCC does not match, we should still output\r\nyaml (but return a non-zero exit code).\r\n\r\nAdd more tests to router.sh for more scenarios.\r\n\r\nFixes #8252\r\n\r\n@simon3z","created_at":"2016-03-30T16:18:27Z","updated_at":"2016-03-31T04:52:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19e85358b6ef4733cfea8d681b37e575e99ebb41","assignee":null,"milestone":{"url":"https://api.github.com/repos/openshift/origin/milestones/11","html_url":"https://github.com/openshift/origin/milestones/1.2.0","labels_url":"https://api.github.com/repos/openshift/origin/milestones/11/labels","id":1502487,"number":11,"title":"1.2.0","description":"","creator":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":140,"state":"open","created_at":"2016-01-12T16:06:32Z","updated_at":"2016-03-30T16:19:26Z","due_on":"2016-04-09T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/openshift/origin/pulls/8300/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/8300/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/8300/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/1fd121b487f37d90f41daca4fe6d3cd9b51896c6","head":{"label":"smarterclayton:router_support_hostports","ref":"router_support_hostports","sha":"1fd121b487f37d90f41daca4fe6d3cd9b51896c6","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"repo":{"id":22921364,"name":"origin","full_name":"smarterclayton/origin","owner":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smarterclayton/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/smarterclayton/origin","forks_url":"https://api.github.com/repos/smarterclayton/origin/forks","keys_url":"https://api.github.com/repos/smarterclayton/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smarterclayton/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smarterclayton/origin/teams","hooks_url":"https://api.github.com/repos/smarterclayton/origin/hooks","issue_events_url":"https://api.github.com/repos/smarterclayton/origin/issues/events{/number}","events_url":"https://api.github.com/repos/smarterclayton/origin/events","assignees_url":"https://api.github.com/repos/smarterclayton/origin/assignees{/user}","branches_url":"https://api.github.com/repos/smarterclayton/origin/branches{/branch}","tags_url":"https://api.github.com/repos/smarterclayton/origin/tags","blobs_url":"https://api.github.com/repos/smarterclayton/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smarterclayton/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smarterclayton/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/smarterclayton/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smarterclayton/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/smarterclayton/origin/languages","stargazers_url":"https://api.github.com/repos/smarterclayton/origin/stargazers","contributors_url":"https://api.github.com/repos/smarterclayton/origin/contributors","subscribers_url":"https://api.github.com/repos/smarterclayton/origin/subscribers","subscription_url":"https://api.github.com/repos/smarterclayton/origin/subscription","commits_url":"https://api.github.com/repos/smarterclayton/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/smarterclayton/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/smarterclayton/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/smarterclayton/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/smarterclayton/origin/contents/{+path}","compare_url":"https://api.github.com/repos/smarterclayton/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smarterclayton/origin/merges","archive_url":"https://api.github.com/repos/smarterclayton/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smarterclayton/origin/downloads","issues_url":"https://api.github.com/repos/smarterclayton/origin/issues{/number}","pulls_url":"https://api.github.com/repos/smarterclayton/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/smarterclayton/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/smarterclayton/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smarterclayton/origin/labels{/name}","releases_url":"https://api.github.com/repos/smarterclayton/origin/releases{/id}","deployments_url":"https://api.github.com/repos/smarterclayton/origin/deployments","created_at":"2014-08-13T15:49:23Z","updated_at":"2015-08-31T15:42:11Z","pushed_at":"2016-03-31T02:51:12Z","git_url":"git://github.com/smarterclayton/origin.git","ssh_url":"git@github.com:smarterclayton/origin.git","clone_url":"https://github.com/smarterclayton/origin.git","svn_url":"https://github.com/smarterclayton/origin","homepage":"https://openshift.github.io","size":235844,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"f243e7bde74cb071c93b352b4f4cdf9b4697ce46","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"The Continuous Application Platform - build, deploy, and manage cloud-native and legacy applications on Kubernetes and Docker","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-03-30T23:35:57Z","pushed_at":"2016-03-31T04:36:40Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":307213,"stargazers_count":1174,"watchers_count":1174,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":718,"mirror_url":null,"open_issues_count":979,"forks":718,"open_issues":979,"watchers":1174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/8300"},"html":{"href":"https://github.com/openshift/origin/pull/8300"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/8300"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/8300/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/8300/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/8300/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/1fd121b487f37d90f41daca4fe6d3cd9b51896c6"}}}}