-
Notifications
You must be signed in to change notification settings - Fork 6
generate: set omitzero on specific types #289
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Anyone using the client will need to update to Go 1.24 though, no? We should definitely note that as a breaking change in the changelog.
Maybe this will sound like overkill, but can we test these by updating the terraform provider and running the acceptance tests for the instance and VPC firewall rules resources? I've been bitten by this API before and am paranoid now 😅
434972e to
6e0b217
Compare
Done! Let me know if you want me to separate the changelog notes or otherwise do the Go 1.24 update and the addition of
Yep, I will! I'll test it tomorrow. My tomorrow haha. |
|
I split out the Go 1.24 update to #291. |
Looks like it's already in two PRs 😄 Sounds good to me! |
c2f5cf5 to
040010f
Compare
|
I checked out the changes in oxidecomputer/terraform-provider-oxide#432. Updated it to use the Go SDK changes in this pull request. diff --git a/go.mod b/go.mod
index adfd4f53ff..62fce3208f 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/oxidecomputer/terraform-provider-oxide
-go 1.23.0
+go 1.24.3
require (
github.com/google/uuid v1.6.0
@@ -11,7 +11,7 @@
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1
github.com/hashicorp/terraform-plugin-testing v1.12.0
- github.com/oxidecomputer/oxide.go v0.4.1-0.20250423011427-65b1d0f6b391
+ github.com/oxidecomputer/oxide.go v0.4.1-0.20250529141328-040010f4ebec
github.com/stretchr/testify v1.10.0
)
diff --git a/go.sum b/go.sum
index d2db5e7c90..2cdde56808 100644
--- a/go.sum
+++ b/go.sum
@@ -138,6 +138,8 @@
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oxidecomputer/oxide.go v0.4.1-0.20250423011427-65b1d0f6b391 h1:q/ebxcSiqQrrdmDsd+w7gwqZUcGhpHmY9Bu2uYKNGL8=
github.com/oxidecomputer/oxide.go v0.4.1-0.20250423011427-65b1d0f6b391/go.mod h1:yNLdQdroM42/yDIFlCsLAR9PawAdeJZDgHdAx+wcywg=
+github.com/oxidecomputer/oxide.go v0.4.1-0.20250529141328-040010f4ebec h1:iqdsaEnS+y8Crfy0EJlRCI1YAyZMc3vQxL28ZDBUYHo=
+github.com/oxidecomputer/oxide.go v0.4.1-0.20250529141328-040010f4ebec/go.mod h1:4gfHlxdBQLs/34UbChPvINd+pGNAnGlASRGEd4xIz1Y=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=And ran the acceptance tests. |
Set `omitzero` on the following types to allow clients to set an empty slice and have it serialized to `[]`, which is required by Oxide APIs to unset a value. * `[]VpcFirewallRuleUpdate` * `[]NameOrId` The previous behavior would omit an empty slice entirely during serialization, causing the Oxide APIs to respond with an error.
040010f to
c6dcf55
Compare
karencfv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for running the tests!!! Looks great
Set
omitzeroon the following types to allow clients to set an empty slice and have it serialized to[], which is required by Oxide APIs to unset a value.[]VpcFirewallRuleUpdate[]NameOrIdThe previous behavior would omit an empty slice entirely during serialization, causing the Oxide APIs to respond with an error.