Skip to content

Commit

Permalink
api: add explicit DNS cache
Browse files Browse the repository at this point in the history
The API connection logic in juju.NewAPIConnection implements
a half-hearted DNS cache by resolving DNS addresses itself
and storing them in the controllers.yaml fields.
This obscures the actual addresses that have been
returned from the controller.

Instead of that, we make api.Open responsible for
all DNS resolution and pass a DNS cache interface
into DialOpts so that the NewAPIConnection logic
can still do its own DNS caching.

This means that the API connection logic always knows
the symbolic host name of the controller that it's
dialing, which is important when using public certificate
validation.

It also means that even when a Go client calls api.Open with
a single host name, it will get the benefit of concurrent
dialing to each of the resolved IP addresses.
  • Loading branch information
rogpeppe committed May 30, 2017
1 parent 19c2b32 commit 874fbd5
Show file tree
Hide file tree
Showing 4 changed files with 507 additions and 94 deletions.

0 comments on commit 874fbd5

Please sign in to comment.