Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: use
URL
method to get Nomad address for plugins
For #944 we fixed the Nomad API package so that it no longer mutated the private `url` field if previously set, which allowed reusing an `api.Config` object between clients when a unix domain socket was in use. However, the autoscaler plugins for Nomad strategy and target don't use the `api.Config` object we parse directly and instead get a map of string->string derived from that config so it can be passed over the go-plugin interface. This mapping did not account for the `Address` field being mutated when unix domain sockets are in use, so the bug was not actually fixed. Update the mapping to use the safe `URL()` method on the config, rather than reading the `Address` field. Fixes: #955 Ref: hashicorp/nomad#23785
- Loading branch information