Tags: juju/gomaasapi
Tags
Merge pull request #104 from r00ta/lp-2039105 #104 Bugfix for https://bugs.launchpad.net/maas/+bug/2039105. The bug is that in case of retry, the oauth headers are duplicated in the requests and MAAS nginx reject the request with 400. The fix is actually to use `http.Header.Set` instead of `http.Header.Add` in order to set or replace the "Authentication" header.
Merge pull request #101 from r00ta/lp-2034014-add-retry-policy-for-40… …9-responses #101 This PR aims to retry on MAAS responses with status code equal to 409. In particular we observed that in some cases it is possible that the client calls MAAS endpoints in parallel and due to some MAAS internals the requests need to be remade by the clients. [Link to the original bug](https://bugs.launchpad.net/maas/+bug/2034014) [Link to MAAS core merge proposal to add the `Retry-After` header in 409 responses](https://code.launchpad.net/~r00ta/maas/+git/maas/+merge/450867)
Merge pull request #99 from SimonRichardson/optional-hardware-info #99 Unfortunately, HardwareInfo isn't always available for every MAAS version. The prior PR[1] expected that hardware_info was available. The fix is simple, just make it optional when attempting to validate it with the schema coercing. Additionally, I've added a few more tests to ensure that we're testing various scenarios of hardware_info being omitted. Lastly, it felt like there was a missing check for TestReadMachines for validating the hardware info for a given machine response. This should fix[2] in Juju. 1. #96 2. https://bugs.launchpad.net/juju/+bug/2009064
Merge pull request #98 from manadart/v2-client-retry-fix #98 When operating a MAAS controller via TLS, Juju can observe the following error during (sufficiently concurrent) provisioning: ``` net/http: cannot rewind body after connection loss ``` Based on pouring over the `http` standard library, this appears to happen for GET requests without a body, where the retry logic incorrectly replaces a `nil` body with a (non-nil) empty buffer. Here we avoid doing the body reset when it is `nil`. I was not able to recreate the exact failure scenario, but there is a new test that verifies that this change behaves correctly.
Merge pull request #96 from markylaing/tags-hardware-info #96 build build.properties go-path go1.17.11.linux-amd64.tar.gz goversion pr_props Adds a new interface `Tag` (implemented by `tag` in `tags.go`) for interacting with MAAS tags. * Adds a method `Tags() ([]Tag, error)` to the `Controller` for retrieving a slice of MAAS tags. * Adds `Tags` to `MachineArgs` to allow filtering machines by tag. * Adds a method `HardwareInfo() map[string]string` to the `Machine` interface and implements it. Hardware info is added to `machine` when deserializing the API response. I have tried to follow conventions that I have found elsewhere in the codebase but let me know if I have missed something, thanks 😄