Skip to content
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

connector should lookup server addr only when unset, not when the value is localhost #3380

Closed
dnephin opened this issue Oct 3, 2022 · 0 comments · Fixed by #3383
Closed
Assignees
Labels
kind/bug A report or a fix for a problem with functional correctness.

Comments

@dnephin
Copy link
Contributor

dnephin commented Oct 3, 2022

If someone runs the connector with --server-url=localhost the connector will assume that url is wrong and attempt to lookup the server URL from the kubernetes API using the server service name.

// server is localhost which should never be the case. try to infer the actual host
if strings.HasPrefix(u.Host, "localhost") {

I believe this was from a time when we expected the server and connector to often be run in the same cluster.

It seems fine to lookup the server url when the value is empty, but if someone has specified a url for the server, let's not assume it was the wrong value and attempt to override it.

We could choose to remove this lookup entirely, or we could do the lookup only when the value is the empty string.

I think we may want to always default to a server url of api.infrahq.com, which means the server url should never be empty, and we could remove this lookup.

@dnephin dnephin added the kind/bug A report or a fix for a problem with functional correctness. label Oct 3, 2022
@mxyng mxyng self-assigned this Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A report or a fix for a problem with functional correctness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants