mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
core: CoreBuild.Run error on cancelled builds
When a build is cancelled by a user, the current implementation of CoreBuild.Run does not return an error signifying that there was a problem with the build. This in turn causes the HCP code to attempt to update the status of the build to DONE, but fails because there are no artifacts to push. This commit changes this behaviour by returning the error provoked by the cancellation to the caller, so it can be taken into account when setting the status of the build.
This commit is contained in:
parent
ea1d32e456
commit
f8bc240b02
1 changed files with 1 additions and 1 deletions
|
|
@ -238,7 +238,7 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi packersdk.Ui) ([]packers
|
|||
select {
|
||||
case <-ctx.Done():
|
||||
log.Println("Build was cancelled. Skipping post-processors.")
|
||||
return nil, nil
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue