{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/17156","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/17156/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/17156/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/17156/events","html_url":"https://github.com/openshift/origin/issues/17156","id":270778532,"number":17156,"title":"Router: Provide support for regular-expression route paths","user":{"login":"elyscape","id":792695,"avatar_url":"https://avatars2.githubusercontent.com/u/792695?v=4","gravatar_id":"","url":"https://api.github.com/users/elyscape","html_url":"https://github.com/elyscape","followers_url":"https://api.github.com/users/elyscape/followers","following_url":"https://api.github.com/users/elyscape/following{/other_user}","gists_url":"https://api.github.com/users/elyscape/gists{/gist_id}","starred_url":"https://api.github.com/users/elyscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyscape/subscriptions","organizations_url":"https://api.github.com/users/elyscape/orgs","repos_url":"https://api.github.com/users/elyscape/repos","events_url":"https://api.github.com/users/elyscape/events{/privacy}","received_events_url":"https://api.github.com/users/elyscape/received_events","type":"User","site_admin":false},"labels":[{"id":210156239,"url":"https://api.github.com/repos/openshift/origin/labels/component/routing","name":"component/routing","color":"0052cc","default":false},{"id":118251701,"url":"https://api.github.com/repos/openshift/origin/labels/kind/enhancement","name":"kind/enhancement","color":"84b6eb","default":false},{"id":210151912,"url":"https://api.github.com/repos/openshift/origin/labels/priority/P2","name":"priority/P2","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"knobunc","id":10033853,"avatar_url":"https://avatars1.githubusercontent.com/u/10033853?v=4","gravatar_id":"","url":"https://api.github.com/users/knobunc","html_url":"https://github.com/knobunc","followers_url":"https://api.github.com/users/knobunc/followers","following_url":"https://api.github.com/users/knobunc/following{/other_user}","gists_url":"https://api.github.com/users/knobunc/gists{/gist_id}","starred_url":"https://api.github.com/users/knobunc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knobunc/subscriptions","organizations_url":"https://api.github.com/users/knobunc/orgs","repos_url":"https://api.github.com/users/knobunc/repos","events_url":"https://api.github.com/users/knobunc/events{/privacy}","received_events_url":"https://api.github.com/users/knobunc/received_events","type":"User","site_admin":false},"assignees":[{"login":"knobunc","id":10033853,"avatar_url":"https://avatars1.githubusercontent.com/u/10033853?v=4","gravatar_id":"","url":"https://api.github.com/users/knobunc","html_url":"https://github.com/knobunc","followers_url":"https://api.github.com/users/knobunc/followers","following_url":"https://api.github.com/users/knobunc/following{/other_user}","gists_url":"https://api.github.com/users/knobunc/gists{/gist_id}","starred_url":"https://api.github.com/users/knobunc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knobunc/subscriptions","organizations_url":"https://api.github.com/users/knobunc/orgs","repos_url":"https://api.github.com/users/knobunc/repos","events_url":"https://api.github.com/users/knobunc/events{/privacy}","received_events_url":"https://api.github.com/users/knobunc/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-11-02T19:25:34Z","updated_at":"2018-02-24T11:23:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have [a custom router][origin-router-regexp] based on the default HAProxy-based router that provides regular expression-based path routing. Unfortunately, as described in elyscape/origin-router-regexp#1, #12580 (which was first shipped in v1.5.0-rc3) changed the way that ports are handled. Instead of stripping them entirely, the request's base URI is matched against (in most cases) the output of `generateRouteRegexp $cfg.Host $cfg.Path $cfg.IsWildcard`. [`generateRouteRegexp`][generateRouteRegexp] is a function that builds a regular expression that, in general, follows the following pattern:\r\n```\r\n^${regexp.QuoteMeta($cfg.Host)}(:[0-9]+)?${regexp.QuoteMeta($cfg.Path)}(/.*)?$\r\n```\r\nTranslated into words, this matches a string containing precisely the literal hostname, an optional port, the literal path, and optionally any subpaths thereof. This is useful in the general case, but unfortunately breaks my router. It would be nice if this regular-expression functionality on the path could be added to the base router, perhaps enabled by an annotation on the route.\r\n\r\nTo explain why I made this router, I'll describe my use case. I have two services that need to be accessible on the same hostname (let's say `service.example.com`). One provides a REST API and the other provides a WebSocket channel. Unfortunately, the WebSocket channel is made available through a URL that looks like this `service.example.com/$contextId/socket`. In other words, the path that needs to be routed to the WebSocket service is accessed via a URL that has a variable prefix and a static suffix. This means that the standard OpenShift path routes won't work, as they assume a static prefix and an optional variable suffix. For various reasons, I can't move the WebSocket service to a different subdomain. To deal with this, I created my regular expression router and made a route with the path set to `/[^/]+/socket`.\r\n\r\nI didn't notice this issue earlier because we're still running the 1.3 series of OpenShift Origin.\r\n\r\n[origin-router-regexp]: https://github.com/elyscape/origin-router-regexp\r\n[generateRouteRegexp]: https://github.com/openshift/origin/blob/3ea2451f084347a0ecd2a52556f93bf995ff1380/pkg/router/template/template_helper.go#L99-L130"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/368221666","html_url":"https://github.com/openshift/origin/issues/17156#issuecomment-368221666","issue_url":"https://api.github.com/repos/openshift/origin/issues/17156","id":368221666,"user":{"login":"openshift-bot","id":1779249,"avatar_url":"https://avatars2.githubusercontent.com/u/1779249?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift-bot","html_url":"https://github.com/openshift-bot","followers_url":"https://api.github.com/users/openshift-bot/followers","following_url":"https://api.github.com/users/openshift-bot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-bot/subscriptions","organizations_url":"https://api.github.com/users/openshift-bot/orgs","repos_url":"https://api.github.com/users/openshift-bot/repos","events_url":"https://api.github.com/users/openshift-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-bot/received_events","type":"User","site_admin":false},"created_at":"2018-02-24T11:23:43Z","updated_at":"2018-02-24T11:23:43Z","author_association":"MEMBER","body":"Issues go stale after 90d of inactivity.\n\nMark the issue as fresh by commenting `/remove-lifecycle stale`.\nStale issues rot after an additional 30d of inactivity and eventually close.\nExclude this issue from closing by commenting `/lifecycle frozen`.\n\nIf this issue is safe to close now please do so with `/close`.\n\n/lifecycle stale"}}
{"actor":{"display_login":"openshift-bot"}}