Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report metadata only when the build completes #12923

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions internal/hcp/registry/hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ func (h *HCLRegistry) CompleteBuild(
buildName = cb.Type
}

buildMetadata := cb.GetMetadata()
err := h.bucket.Version.AddMetadataToBuild(ctx, buildName, buildMetadata)
if err != nil {
return nil, err
}
return h.bucket.completeBuild(ctx, buildName, artifacts, buildErr)
}

Expand Down
6 changes: 0 additions & 6 deletions internal/hcp/registry/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ func (h *JSONRegistry) PopulateVersion(ctx context.Context) error {
// StartBuild is invoked when one build for the configuration is starting to be processed
func (h *JSONRegistry) StartBuild(ctx context.Context, build sdkpacker.Build) error {
name := build.Name()

metadata := build.(*packer.CoreBuild).GetMetadata()
err := h.bucket.Version.AddMetadataToBuild(ctx, name, metadata)
if err != nil {
return err
}
return h.bucket.startBuild(ctx, name)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/hcp/registry/types.bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (bucket *Bucket) UpdateBuildStatus(
nil,
status,
nil,
&buildToUpdate.Metadata,
nil,
)
if err != nil {
return err
Expand Down
Loading