poc/with-api-imported
Devashish 2 years ago committed by Jenna Goldstrich
parent f0a3b3efe6
commit 99c10d42c0

@ -12,6 +12,8 @@ import (
"sync"
"time"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service"
hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models"
@ -223,7 +225,7 @@ func (bucket *Bucket) UpdateBuildStatus(
return nil
}
func (bucket *Bucket) uploadSbom(ctx context.Context, buildName string, compressedSbom []byte) error {
func (bucket *Bucket) uploadSbom(ctx context.Context, buildName string, sbom packer.SBOM) error {
buildToUpdate, err := bucket.Version.Build(buildName)
if err != nil {
return err
@ -242,7 +244,7 @@ func (bucket *Bucket) uploadSbom(ctx context.Context, buildName string, compress
Fingerprint: bucket.Version.Fingerprint,
BuildID: buildToUpdate.ID,
Body: &hcpPackerModels.HashicorpCloudPacker20230101UploadSbomBody{
CompressedSbom: compressedSbom,
CompressedSbom: sbom.CompressedData,
},
},
nil,

@ -6,6 +6,8 @@ package registry
import (
"fmt"
"github.com/hashicorp/packer/packer"
hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models"
packerSDKRegistry "github.com/hashicorp/packer-plugin-sdk/packer/registry/image"
)
@ -21,7 +23,7 @@ type Build struct {
Status hcpPackerModels.HashicorpCloudPacker20230101BuildStatus
Metadata hcpPackerModels.HashicorpCloudPacker20230101BuildMetadata
CompressedSboms [][]byte
CompressedSboms []packer.SBOM
}
// NewBuildFromCloudPackerBuild converts a HashicorpCloudPackerBuild to a local build that can be tracked and

Loading…
Cancel
Save