-
Notifications
You must be signed in to change notification settings - Fork 79
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
Update Loadbalancer SSL Certificate #702
Comments
I can reproduce this. Looks like we now sent (broken) empty options in the request. Request from CLI 1.36.0: --- Request:
POST /v1/load_balancers/1710364/actions/update_service HTTP/1.1
Host: api.hetzner.cloud
User-Agent: hcloud-cli/unknown hcloud-go/1.47.0
Content-Length: 80
Authorization: REDACTED
Content-Type: application/json
Accept-Encoding: gzip
{"listen_port":443,"destination_port":8080,"http":{},"health_check":{"http":{}}}
--- Response:
HTTP/2.0 201 Created Request from CLI v1.42.0: --- Request:
POST /v1/load_balancers/1710364/actions/update_service HTTP/1.1
Host: api.hetzner.cloud
User-Agent: hcloud-cli/1.42.0-dev hcloud-go/2.6.0
Content-Length: 118
Authorization: REDACTED
Content-Type: application/json
Accept-Encoding: gzip
{"listen_port":443,"destination_port":8080,"http":{"certificates":null},"health_check":{"http":{"status_codes":null}}}
--- Response:
HTTP/2.0 422 Unprocessable Entity |
By bisecting I found out that is is broken since commit 59d73f4, which bumped us to hcloud-go v2.5.0. Further bisecting Will take a look into fixing this. |
In the conversion from LoadBalancerUpdateServiceOpts to schema.LoadBalancerActionUpdateServiceRequest, there are conversions from slices to slice pointers. Slice pointers exist in schemas to differentiate between absent and empty. Goverter converts nil slices to &nil. This leads to the field being marshaled to `null` in JSON (even with the `omitempty` flag) instead of being not present (See hetznercloud/cli#702) This PR fixes this issue by adding manual conversion methods
In the conversion from LoadBalancerUpdateServiceOpts to schema.LoadBalancerActionUpdateServiceRequest, there are conversions from slices to slice pointers. Slice pointers exist in schemas to differentiate between absent and empty. Goverter converts nil slices to &nil. This leads to the field being marshaled to `null` in JSON (even with the `omitempty` flag) instead of being not present (See hetznercloud/cli#702) This PR fixes this issue by adding manual conversion methods and adds tests to account for this behavior. --------- Co-authored-by: pauhull <[email protected]>
Should be fixed with #720. Can you please confirm that it works for you with
|
@phm07 it works fine with newest go version. Thank you!
|
TL;DR
I have a simple shell script for updating loadbalancer certificates with renewed lets encrypt certs. My script works with v1.36 and now I got an error.
Expected behavior
Observed behavior
Minimal working example
Log output
Additional information
The text was updated successfully, but these errors were encountered: