Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Oct 5, 2020

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

@openshift-ci-robot openshift-ci-robot added the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Oct 5, 2020
@wking
Copy link
Member Author

wking commented Oct 5, 2020

Some potential consumers:

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Oct 5, 2020
Copy link
Contributor

@Miciah Miciah left a 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.

@wking
Copy link
Member Author

wking commented Oct 5, 2020

It might make sense to add a test case with Admitted=False.

Done with explicitly non-admitted ingress, host-agnostic in 08e24b1 -> c125aa6.

@Miciah
Copy link
Contributor

Miciah commented Oct 5, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2020
@deads2k
Copy link
Contributor

deads2k commented Oct 6, 2020

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 pkg/route/routeapihelpers in case a different category of route related code arrives.

/approve
/hold

holding for package update. Feel free to merge after.

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 6, 2020
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)
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
@wking
Copy link
Member Author

wking commented Oct 6, 2020

I would like to see pkg/route/routeapihelpers in case a different category of route related code arrives.

Done with c125aa6 -> 18b0170, and now it needs a re-lgtm.

@Miciah
Copy link
Contributor

Miciah commented Oct 6, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2020
@openshift-ci-robot
Copy link

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wking
Copy link
Member Author

wking commented Oct 6, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2020
@openshift-merge-robot openshift-merge-robot merged commit f360b98 into openshift:master Oct 6, 2020
@wking wking deleted the route-helpers branch October 6, 2020 23:09
wking added a commit to wking/cluster-authentication-operator that referenced this pull request Oct 6, 2020
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
wking added a commit to wking/cluster-authentication-operator that referenced this pull request Oct 7, 2020
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
wking added a commit to wking/openshift-installer that referenced this pull request Nov 3, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants