Skip to content

Commit

Permalink
Upgrade to genesiscloud-go v1.0.11 (#124)
Browse files Browse the repository at this point in the history
* Upgrade to genesiscloud-go v1.0.11

* Satisfy linter

* go mod tidy
  • Loading branch information
skirsten authored Oct 24, 2024
1 parent a93d04d commit e8e5e14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.23.1

require (
github.com/genesiscloud/genesiscloud-go v1.0.10
github.com/genesiscloud/genesiscloud-go v1.0.11
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/terraform-plugin-docs v0.19.4
github.com/hashicorp/terraform-plugin-framework v1.12.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/genesiscloud/genesiscloud-go v1.0.10 h1:IGu7c2SOlW3NQ71e8a7wdPUvpLzrjo1gt5unD6CTjCQ=
github.com/genesiscloud/genesiscloud-go v1.0.10/go.mod h1:t2m8sfDGOa8pFio3oitkkjW9YcajyxkiWEu+BHOLyes=
github.com/genesiscloud/genesiscloud-go v1.0.11 h1:SjhBrZ2YXvWspQbfl48lUR+otqXS30QF97fO4TMJXjI=
github.com/genesiscloud/genesiscloud-go v1.0.11/go.mod h1:t2m8sfDGOa8pFio3oitkkjW9YcajyxkiWEu+BHOLyes=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
Expand Down
16 changes: 14 additions & 2 deletions internal/provider/instance_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,25 @@ func (r *InstanceResource) Update(ctx context.Context, req resource.UpdateReques
if !data.SecurityGroupIds.IsNull() && !data.SecurityGroupIds.IsUnknown() {
var securityGroups []string
data.SecurityGroupIds.ElementsAs(ctx, &securityGroups, false)
body.SecurityGroups = &securityGroups
body.SecurityGroups = &genesiscloud.InstanceUpdateSecurityGroups{}

err := body.SecurityGroups.FromInstanceUpdateSecurityGroupsList(securityGroups)
if err != nil {
resp.Diagnostics.AddError("Client Error", generateErrorMessage("update instance", err))
return
}
}

if !data.VolumeIds.IsNull() && !data.VolumeIds.IsUnknown() {
var volumeIds []string
data.VolumeIds.ElementsAs(ctx, &volumeIds, false)
body.Volumes = &volumeIds
body.Volumes = &genesiscloud.InstanceUpdateVolumes{}

err := body.Volumes.FromInstanceUpdateVolumesList(volumeIds)
if err != nil {
resp.Diagnostics.AddError("Client Error", generateErrorMessage("update instance", err))
return
}
}

if !data.DiskSize.IsNull() && !data.DiskSize.IsUnknown() {
Expand Down

0 comments on commit e8e5e14

Please sign in to comment.