Skip to content

Commit

Permalink
Update Go SDK to 172bbb155e83 (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv authored Jan 22, 2024
1 parent ebb36e6 commit 86c03ed
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
github.com/hashicorp/terraform-plugin-testing v1.6.0
github.com/oxidecomputer/oxide.go v0.0.0-20231220001919-3d15f3d1e87e
github.com/oxidecomputer/oxide.go v0.0.0-20240122082158-172bbb155e83
github.com/stretchr/testify v1.8.4
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oxidecomputer/oxide.go v0.0.0-20231220001919-3d15f3d1e87e h1:QD/kiXJLqvh7m9DfEyazvm4oM7/qP5Urq12/tEI3+c0=
github.com/oxidecomputer/oxide.go v0.0.0-20231220001919-3d15f3d1e87e/go.mod h1:Y2mLnNMVceBFGgxCzJKZGThRltJiTSeW3JzE3CA95As=
github.com/oxidecomputer/oxide.go v0.0.0-20240122082158-172bbb155e83 h1:Nkjps2D50kgjvKm/J6+hUaOuU6Svdg40cCohft7m1GY=
github.com/oxidecomputer/oxide.go v0.0.0-20240122082158-172bbb155e83/go.mod h1:Y2mLnNMVceBFGgxCzJKZGThRltJiTSeW3JzE3CA95As=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
9 changes: 7 additions & 2 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package provider

import (
"context"
"fmt"
"os"

"github.com/hashicorp/terraform-plugin-framework/datasource"
Expand Down Expand Up @@ -107,8 +108,12 @@ func (p *oxideProvider) Configure(ctx context.Context, req provider.ConfigureReq
ctx = tflog.MaskFieldValuesWithFieldKeys(ctx, "token")
tflog.Debug(ctx, "Creating Oxide client")

// TODO: Add provider version to the user agent?
client, err := oxide.NewClient(token, "terraform-provider-oxide", host)
config := oxide.Config{
Token: token,
UserAgent: fmt.Sprintf("terraform-provider-oxide/%s", Version),
Host: host,
}
client, err := oxide.NewClient(&config)
if err != nil {
resp.Diagnostics.AddError(
"An error occurred while initializing the client for the Oxide API",
Expand Down
7 changes: 6 additions & 1 deletion internal/provider/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ func testAccPreCheck(t *testing.T) {
func newTestClient() (*oxide.Client, error) {
host, token := setAccFromEnvVar()

client, err := oxide.NewClient(token, "terraform-provider-oxide-test", host)
config := oxide.Config{
Token: token,
UserAgent: "terraform-provider-oxide-test",
Host: host,
}
client, err := oxide.NewClient(&config)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 86c03ed

Please sign in to comment.