diff --git a/go.mod b/go.mod index 96d4b5bf1d9..05ad096260f 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-version v1.3.0 github.com/hashicorp/hcl/v2 v2.10.0 - github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210717111725-9bb3c21afe93 + github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210727200019-239ce8d80646 github.com/hashicorp/packer-plugin-alicloud v1.0.0 github.com/hashicorp/packer-plugin-amazon v1.0.0 github.com/hashicorp/packer-plugin-ansible v1.0.0 diff --git a/go.sum b/go.sum index 4c649e2304c..f6b66975cd7 100644 --- a/go.sum +++ b/go.sum @@ -675,8 +675,8 @@ github.com/hashicorp/hcl/v2 v2.8.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yI github.com/hashicorp/hcl/v2 v2.9.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg= github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= -github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210717111725-9bb3c21afe93 h1:tCWmkmMKLZQIi53OpIAdqDw1PmtqbqFLBQYcY2sKIFQ= -github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210717111725-9bb3c21afe93/go.mod h1:Tm9BAlTkp6jknZ0YNxF/556JBC/meCN1LUmWFN38HsU= +github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210727200019-239ce8d80646 h1:4WbtYgGIxeRrGC0hGBtOi6XuJ23024H7r724rCL+eXI= +github.com/hashicorp/hcp-sdk-go v0.10.1-0.20210727200019-239ce8d80646/go.mod h1:Tm9BAlTkp6jknZ0YNxF/556JBC/meCN1LUmWFN38HsU= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= diff --git a/internal/packer_registry/registry.go b/internal/packer_registry/registry.go index 504b6e7a297..26f49b64b3d 100644 --- a/internal/packer_registry/registry.go +++ b/internal/packer_registry/registry.go @@ -4,7 +4,6 @@ import ( "context" "errors" - "github.com/go-openapi/runtime" packerSvc "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2021-04-30/client/packer_service" "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/preview/2021-04-30/models" "google.golang.org/grpc/codes" @@ -18,7 +17,7 @@ func CreateBucket(ctx context.Context, client *Client, input *models.HashicorpCl params.LocationProjectID = client.ProjectID params.Body = input - resp, err := client.Packer.CreateBucket(params, nil, func(*runtime.ClientOperation) {}) + resp, err := client.Packer.CreateBucket(params, nil) if err != nil { return "", err } @@ -48,7 +47,7 @@ func UpsertBucket(ctx context.Context, client *Client, input *models.HashicorpCl Description: input.Description, Labels: input.Labels, } - _, err = client.Packer.UpdateBucket(params, nil, func(*runtime.ClientOperation) {}) + _, err = client.Packer.UpdateBucket(params, nil) return err } @@ -67,7 +66,7 @@ func CreateIteration(ctx context.Context, client *Client, input *models.Hashicor params.BucketSlug = input.BucketSlug params.Body = input - it, err := client.Packer.CreateIteration(params, nil, func(*runtime.ClientOperation) {}) + it, err := client.Packer.CreateIteration(params, nil) if err != nil { return "", err } @@ -85,7 +84,7 @@ func GetIteration(ctx context.Context, client *Client, bucketslug string, finger // for now, we only care about fingerprint so we're hardcoding it. params.Fingerprint = &fingerprint - it, err := client.Packer.GetIteration(params, nil, func(*runtime.ClientOperation) {}) + it, err := client.Packer.GetIteration(params, nil) if err != nil { return "", err } @@ -101,7 +100,7 @@ func CreateBuild(ctx context.Context, client *Client, input *models.HashicorpClo params.BuildIterationID = input.Build.IterationID params.Body = input - resp, err := client.Packer.CreateBuild(params, nil, func(*runtime.ClientOperation) {}) + resp, err := client.Packer.CreateBuild(params, nil) if err != nil { return "", err } @@ -116,7 +115,7 @@ func ListBuilds(ctx context.Context, client *Client, bucketSlug string, iteratio params.BucketSlug = bucketSlug params.IterationID = iterationID - resp, err := client.Packer.ListBuilds(params, nil, func(*runtime.ClientOperation) {}) + resp, err := client.Packer.ListBuilds(params, nil) if err != nil { return []*models.HashicorpCloudPackerBuild{}, err } @@ -131,7 +130,7 @@ func UpdateBuild(ctx context.Context, client *Client, input *models.HashicorpClo params.LocationProjectID = client.ProjectID params.Body = input - resp, err := client.Packer.UpdateBuild(params, nil, func(*runtime.ClientOperation) {}) + resp, err := client.Packer.UpdateBuild(params, nil) if err != nil { return "", err } diff --git a/internal/packer_registry/types.bucket.go b/internal/packer_registry/types.bucket.go index aa520c14b57..afa1256922c 100644 --- a/internal/packer_registry/types.bucket.go +++ b/internal/packer_registry/types.bucket.go @@ -120,7 +120,7 @@ func (b *Bucket) Initialize(ctx context.Context) error { found = true log.Printf("build of component type %s already exists; skipping the create call", expected) - if *existing.Status == models.HashicorpCloudPackerBuildStatusDONE { + if existing.Status == models.HashicorpCloudPackerBuildStatusDONE { // We also need to remove the builds that are _complete_ from the // Iteration's expectedBuilds so we don't overwrite them. //b.Iteration.expectedBuilds = append(b.Iteration.expectedBuilds[:i], b.Iteration.expectedBuilds[i+1:]...) @@ -215,7 +215,7 @@ func (b *Bucket) PublishBuildStatus(ctx context.Context, name string, status mod Updates: &models.HashicorpCloudPackerBuildUpdates{ PackerRunUUID: buildToUpdate.RunUUID, Labels: buildToUpdate.Metadata, - Status: &status, + Status: status, }, } @@ -254,7 +254,7 @@ func (b *Bucket) CreateInitialBuildForIteration(ctx context.Context, name string ComponentType: name, IterationID: b.Iteration.ID, PackerRunUUID: b.Iteration.RunUUID, - Status: &status, + Status: status, }, }