Skip to content

Commit

Permalink
chore: update Go SDK to v6 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta authored Jan 2, 2024
1 parent 09057e1 commit 0bbeb67
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Fixed
- Update UpCloud Go SDK to v6 and fix security vulnerabilities

## [1.5.2] - 2022-12-15

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion builder/upcloud/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/packer-plugin-sdk/packer/registry/image"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/upcloud/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/packer/registry/image"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion builder/upcloud/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/packer-plugin-sdk/communicator"
"github.com/hashicorp/packer-plugin-sdk/multistep"
Expand Down
4 changes: 2 additions & 2 deletions builder/upcloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/request"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/request"
"github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/communicator"
"github.com/hashicorp/packer-plugin-sdk/packer"
Expand Down
2 changes: 1 addition & 1 deletion builder/upcloud/step_create_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer-plugin-sdk/packerbuilderdata"
Expand Down
4 changes: 2 additions & 2 deletions builder/upcloud/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"time"

"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/request"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/request"
"github.com/hashicorp/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer-plugin-sdk/packer"
)
Expand Down
4 changes: 2 additions & 2 deletions builder/upcloud/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/request"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/request"
"github.com/hashicorp/packer-plugin-sdk/multistep"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/UpCloudLtd/packer-plugin-upcloud
go 1.20

require (
github.com/UpCloudLtd/upcloud-go-api/v5 v5.1.0
github.com/UpCloudLtd/upcloud-go-api/v6 v6.11.0
github.com/hashicorp/hcl/v2 v2.16.2
github.com/hashicorp/packer-plugin-sdk v0.5.1
github.com/stretchr/testify v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nu
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns=
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/UpCloudLtd/upcloud-go-api/v5 v5.1.0 h1:8xsPsKvz88DbP8MPk8q18ZIBoiTzcbGEfmy0ZVsTbrY=
github.com/UpCloudLtd/upcloud-go-api/v5 v5.1.0/go.mod h1:AujcayelvOLjiwbulTrC0wzbykpsrcNcc1HuZ3Tloek=
github.com/UpCloudLtd/upcloud-go-api/v6 v6.11.0 h1:8KvsimMoPPBx8IVebtHJHavrJPoJfNL5jsyW4TAC5m4=
github.com/UpCloudLtd/upcloud-go-api/v6 v6.11.0/go.mod h1:I8rWmBBl+OhiY3AGzKbrobiE5TsLCLNYkCQxE4eJcTg=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
12 changes: 6 additions & 6 deletions internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"strings"
"time"

"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/client"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/request"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud/service"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/client"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/request"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud/service"
)

const (
Expand Down Expand Up @@ -80,8 +80,8 @@ func (d *driver) CreateServer(ctx context.Context, opts *ServerOpts) (*upcloud.S
request := d.prepareCreateRequest(opts)
response, err := d.svc.CreateServer(ctx, request)
if err != nil {
var upcloudErr *upcloud.Error
if errors.As(err, &upcloudErr) && upcloudErr.ErrorCode == upcloudErrorCodeMetadataDisabled {
var upcloudErr *upcloud.Problem
if errors.As(err, &upcloudErr) && upcloudErr.ErrorCode() == upcloudErrorCodeMetadataDisabled {
request.Metadata = upcloud.True
if response, err = d.svc.CreateServer(ctx, request); err != nil {
return nil, fmt.Errorf("Error creating metadata enabled server: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion post-processor/upcloud-import/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
)

const artifactDestroyTimeout time.Duration = time.Minute * 30
Expand Down
2 changes: 1 addition & 1 deletion post-processor/upcloud-import/post-processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps"
Expand Down
2 changes: 1 addition & 1 deletion post-processor/upcloud-import/step_create_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer-plugin-sdk/packer"
)
Expand Down
2 changes: 1 addition & 1 deletion post-processor/upcloud-import/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/UpCloudLtd/packer-plugin-upcloud/internal/driver"
"github.com/UpCloudLtd/upcloud-go-api/v5/upcloud"
"github.com/UpCloudLtd/upcloud-go-api/v6/upcloud"
"github.com/hashicorp/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer-plugin-sdk/packer"
)
Expand Down

0 comments on commit 0bbeb67

Please sign in to comment.