Skip to content

Commit

Permalink
registry: only update status on status update
Browse files Browse the repository at this point in the history
Prior to this commit, we'd send updates to both the labels and the
cloud-provider whenever an update to the status of a build would be
sent.

This would cause a bug in which once a build reached the post-processing
state, and its cloud-provider was set, the status could not be updated
anymore, as the cloud-provider would be set and further updates are
rejected by the platform.

To avoid this problem, we only transmit the status when doing a status
update, and no other fields along with it.
  • Loading branch information
lbajolet-hashicorp committed Jun 17, 2022
1 parent c5452ec commit c31a436
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/registry/types.bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ func (b *Bucket) UpdateBuildStatus(ctx context.Context, name string, status mode
_, err = b.client.UpdateBuild(ctx,
buildToUpdate.ID,
buildToUpdate.RunUUID,
buildToUpdate.CloudProvider,
"",
"",
buildToUpdate.Labels,
"",
nil,
status,
nil,
)
Expand Down

0 comments on commit c31a436

Please sign in to comment.