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

Fix issue with choosing a client addr that is 0.0.0.0 or :: #4403

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Jul 16, 2018

This fixes some issue where using the default client address of 0.0.0.0 or a custom one of :: will cause watch plans and managed proxies not to communicate correctly back with the agents HTTP api.

Extra logic was added into the RuntimeConfig class to generate a set of client addresses and in the process convert 0.0.0.0 -> 127.0.0.1 and :: -> ::1.

In addition to the extra tests which cover the default cases of having a client address of 0.0.0.0 or :: some manual test I did included.

  • Tested watch plan with HTTPs only API and default client addr connects to 127.0.0.1 over HTTPS
  • Tested watch plan with HTTPs only API and client addr of :: to ensure it connects using ::1
  • Tested watch plan with HTTPs only API and client addr of 10.X.Y.Z to ensure it connects using that address
  • Tested watch plan with HTTPs only API and multiple client addresses to ensure any non-ANY addresses were preferred.
  • Tested connect proxy with HTTPs only API and all of the scenarios.

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I don't see anything that stands out as wrong and the test coverage looks great, but I also don't 100% understand the impl/problem so more eyes would be good.

@mkeeler
Copy link
Member Author

mkeeler commented Jul 17, 2018

@mitchellh The problem was that the logic added recently to tell proxies and watches about the correct http(s) address of the API didn't account for those addresses being 0.0.0.0 or :: which the API client cannot connect to. For those cases we should just select 127.0.0.1 or ::1 as the API address to use.

This is similar to what @banks did recently when choosing a address to use for the tcp health checks of the managed proxy.

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I'd approved this already. Good job Matt.

@mkeeler mkeeler merged commit 3859291 into master Jul 17, 2018
@mkeeler mkeeler deleted the bugfix/choose-client-address branch July 20, 2018 13:46
@mkeeler mkeeler added this to the 1.2.2 milestone Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants