Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: onboard Equinix Metal client #7

Merged
merged 407 commits into from
Dec 12, 2023
Merged

feat: onboard Equinix Metal client #7

merged 407 commits into from
Dec 12, 2023

Conversation

ctreatma
Copy link
Contributor

This adds support for Equinix Metal, identical to what is implemented in equinix-labs/metal-go as of the time of this PR.

ctreatma and others added 30 commits November 16, 2022 14:37
Update code generation to use latest openapi-generator
Signed-off-by: Marques Johansson <[email protected]>
Signed-off-by: Marques Johansson <[email protected]>
Signed-off-by: Marques Johansson <[email protected]>
Use latest upstream openapitools
API Sync by GitHub Action (2023-01-18)
API Sync by GitHub Action (2023-01-19)
equinix-labs@auto-commit-workflow and others added 26 commits October 2, 2023 16:15
This API Sync PR was automated through [GitHub Actions
workflow_displatch](https://github.com/equinix-labs/metal-go/actions?query=event%3Aworkflow_dispatch)
on 2023-10-12.

* latest Swagger is fetched
* patches have been applied
* generated client has been updated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This API Sync PR was automated through [GitHub Actions
workflow_displatch](https://github.com/equinix-labs/metal-go/actions?query=event%3Aworkflow_dispatch)
on 2023-10-12.

* latest Swagger is fetched
* patches have been applied
* generated client has been updated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This API Sync PR was automated through [GitHub Actions
workflow_displatch](https://github.com/equinix-labs/metal-go/actions?query=event%3Aworkflow_dispatch)
on 2023-11-01.

* latest Swagger is fetched
* patches have been applied
* generated client has been updated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Charles Treatman <[email protected]>
This updates the `formatErrorMessage` helper so that, if the API
responded with an Error model, the messages from that Error model are
appended to the status code & status description. This makes it easier
for users to get visibility into why an API call failed.

I chose to leave the existing code to support rfc7807 messages in place,
just in case we ever migrate to that standard.

Fixes #168
Upgrading the generator to v7.1.0 brings in required field validation,
which will enable the SDK to determine the schema of an object in an API
response based on the presence or absence of required fields. In
addition, v7.1.0 has enum validation built in, so we no longer need a
custom template to implement that.

In order to generate valid code I had to remove some new `defaultValue`
code from `api.mustache`, since that template code does not correctly
handle array properties.
We hadn't introduced custom templates when we updated `client.go` to
dump deprecation & sunset headers to match `packngo` behavior; that
change was made with a post-patch instead. Now that we are heavily using
custom templates to get the generator to spit out the code we want, we
can move all client modifications to the `client.mustache` template and
avoid potential adverse interactions between the post-patch and the
custom template.
This API Sync PR was automated through [GitHub Actions
workflow_displatch](https://github.com/equinix-labs/metal-go/actions?query=event%3Aworkflow_dispatch)
on 2023-11-08.

* latest Swagger is fetched
* patches have been applied
* generated client has been updated

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@cprivitere reported that cluster-api-provider-packet experiences nil
pointer errors when debugging is enabled and a request has no body. This
behavior seems to have started in v0.25.1, which introduced automatic
auth token redaction in debug output.

In order to redact the auth token without impacting the original
request, we were cloning the request object. In order to clone the
request body, we had to call `request.GetBody()`, but that function
causes a nil pointer error if the request body is nil.

This updates the auth token redaction code to temporarily overwrite the
auth token in the original request, rather than cloning the request &
its potentially-nil body.
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-go](https://togithub.com/actions/setup-go) | action |
major | `v4` -> `v5` |

---

### Release Notes

<details>
<summary>actions/setup-go (actions/setup-go)</summary>

### [`v5`](https://togithub.com/actions/setup-go/compare/v4...v5)

[Compare Source](https://togithub.com/actions/setup-go/compare/v4...v5)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/equinix-labs/metal-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
While testing the new cluster API 1.5 changes in
kubernetes-sigs/cluster-api-provider-packet#674
We discovered the API was returning down,down for the bgpsessionstatus
after enabling BGP on a device. This didn't match any of the values in
the enum and would return an error.
@ctreatma  recommends we remove this enum and go back to just a string.

---------

Signed-off-by: Chris Privitere <[email protected]>
Co-authored-by: Charles Treatman <[email protected]>
@ctreatma ctreatma merged commit 7f9339c into main Dec 12, 2023
3 checks passed
@ctreatma ctreatma deleted the onboard-metal branch December 12, 2023 19:25
Copy link
Contributor

This PR is included in version 0.30.0 🎉

1 similar comment
Copy link
Contributor

This PR is included in version 0.30.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants