-
Notifications
You must be signed in to change notification settings - Fork 41
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
Get ingress host and CA from space through connect #535
Conversation
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.
lgtm. It would be nice to have some test coverage for the new code, but I'm not sure where we are with tests in up
at this point (looks pretty limited).
e9f96b6
to
32c9902
Compare
nsn := types.NamespacedName{Name: space.Name, Namespace: space.Namespace} | ||
|
||
// cache hit | ||
if i, ok := c.ingresses[nsn]; ok { |
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.
do we need a mutex here? or use something like https://github.com/hashicorp/golang-lru to handle it for us
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.
I don't expect concurrent/multi-threaded access to any of these methods, but I am happy to move to using a purpose built cache just in case
Description of your changes
Closes https://github.com/upbound/team-orchestration/issues/99
Instead of connecting directly to the space using its FQDN and with skipping TLS, query the space through connect to get the ingress host and CA data. This allows for a TLS-secured connection to the space, and unlocks the ability to connect to "connected spaces" (assuming their host is accessible).
With the requirement to pass a context writer and now an ingress reader to a lot of different methods, I decided to wrap these into a new "context" object (
navCtx
) to make things cleaner - rather than passing many args into every method.I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR, as appropriate.How has this code been tested
Blocked on testing in dev until https://github.com/upbound/spaces/pull/1067 is merged, but tested using stubbed responses.