Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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