Files
nomad/.changelog/23785.txt
Tim Gross b7419bc940 api: only set url field in config if previously unset (#23785)
In #16872 we added support for configuring the API client with a unix domain
socket. In order to set the host correctly, we parse the address before mutating
the Address field in the configuration. But this prevents the configuration from
being reused across multiple clients, as the next time we parse the address it
will no longer be pointing to the socket. This breaks consumers like the
autoscaler, which reuse the API config between plugins.

Update the `NewClient` constructor to only override the `url` field if it hasn't
already been parsed. Include a test demonstrating safe reuse with a unix domain
socket.

Ref: https://github.com/hashicorp/nomad-autoscaler/issues/944
Ref: https://github.com/hashicorp/nomad-autoscaler/pull/945
2024-08-09 13:28:04 -04:00

4 lines
130 B
Plaintext

```release-note:bug
api: Fixed a bug where an `api.Config` targeting a unix domain socket could not be reused between clients
```