Skip to content

Commit

Permalink
update hcp-sdk-go
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviamoss committed Jul 28, 2021
1 parent f6749a2 commit 7056b2e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
15 changes: 7 additions & 8 deletions internal/packer_registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions internal/packer_registry/types.bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]...)
Expand Down Expand Up @@ -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,
},
}

Expand Down Expand Up @@ -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,
},
}

Expand Down

0 comments on commit 7056b2e

Please sign in to comment.