-
Notifications
You must be signed in to change notification settings - Fork 250
pkg/route: Add a package with route helpers #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Some potential consumers:
|
Miciah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense to add a test case with Admitted=False.
|
/lgtm |
|
I'm generally wary of "bucket of helpers", but I'm willing to see where it goes. The last three packages I saw like this took nearly six months to untangle enough to separate. I would like to see /approve holding for package update. Feel free to merge after. |
Constructing a usable URI for a route is non-trivial code that is useful in many route consumers. Save consumers a few lines by creating a helper in a shared location for centralized maintenance. Owners from [1], pruning the stale ironcladlou, pravisankar, and ramr entries, and alphabetizing each list. David requested the pkg/route/routeapihelpers package namespacing [2]. [1]: https://github.com/openshift/router/blob/189bd7fd5594e09e85b9af178738ae3550a39995/OWNERS [2]: openshift#911 (comment)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, Miciah, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
Using the helper from [1] to centralize some route handling and error message generation. Generated with: $ emacs pkg/... # everything in the diff $ go get github.com/openshift/library-go@f360b9835cc8815eccc26cb52dafe05d3cbb3e93 go: github.com/openshift/library-go f360b9835cc8815eccc26cb52dafe05d3cbb3e93 => v0.0.0-20201006230840-f360b9835cc8 $ go mod tidy $ go mod vendor $ git add -A go.* vendor using: $ go version go version go1.15.2 linux/amd64 [1]: openshift/library-go#911
Using the helper from [1] to centralize some route handling and error message generation. Generated with: $ emacs pkg/... test/library/waits.go # everything in the diff $ go get github.com/openshift/library-go@f360b9835cc8815eccc26cb52dafe05d3cbb3e93 go: github.com/openshift/library-go f360b9835cc8815eccc26cb52dafe05d3cbb3e93 => v0.0.0-20201006230840-f360b9835cc8 $ go mod tidy $ go mod vendor $ git add -A go.* vendor using: $ go version go version go1.15.2 linux/amd64 [1]: openshift/library-go#911
Using the helper from [1], so we: * No longer hard-code https://. It's calculated based on the route's TLS config. * No longer assume that the available ingress host will match the route's spec.host. * No longer assume that the route is admitted. Now we check the ingress conditions to confirm Admitted=True. Generated with: $ emacs cmd/openshift-install/create.go # everything in the diff $ go mod tidy $ go mod vendor $ git add -A go.* vendor using: $ go version go version go1.15.2 linux/amd64 [1]: openshift/library-go#911
Constructing a usable URI for a route is non-trivial code that is useful in many route consumers. Save consumers a few lines by creating a helper in a shared location for centralized maintenance.
Owners from
router/OWNERS.CC @Miciah