Skip to content

Commit

Permalink
Merge pull request #931 from asottile/clean_up_artifacts_on_error
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Oct 12, 2018
2 parents 4053137 + ea98870 commit 2a78342
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/build/strategies/sti/sti.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ func (builder *STI) Save(config *api.Config) (err error) {
extractErr := builder.tar.ExtractTarStream(artifactTmpDir, outReader)
io.Copy(ioutil.Discard, outReader) // must ensure reader from container is drained
builder.result.BuildInfo.Stages = api.RecordStageAndStepInfo(builder.result.BuildInfo.Stages, api.StageRetrieve, api.StepRetrievePreviousArtifacts, startTime, time.Now())

if extractErr != nil {
builder.fs.RemoveDirectory(artifactTmpDir)
}

return extractErr
}

Expand Down

0 comments on commit 2a78342

Please sign in to comment.