Skip to content

Commit

Permalink
Merge pull request #1080 from buildpacks/dont-calculated-diffIDs-twice
Browse files Browse the repository at this point in the history
Dont calculate buildpack layer diffIDs twice when creating a builder
Signed-off-by: David Freilich <[email protected]>
  • Loading branch information
dfreilich authored Feb 18, 2021
2 parents 0bd1584 + c519a69 commit 650ce05
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) e
return err
}

if err := b.image.AddLayer(bpLayerTar); err != nil {
diffID, err := dist.LayerDiffID(bpLayerTar)
if err != nil {
return errors.Wrapf(err,
"adding layer tar for buildpack %s",
"getting content hashes for buildpack %s",
style.Symbol(bp.Descriptor().Info.FullName()),
)
}

diffID, err := dist.LayerDiffID(bpLayerTar)
if err != nil {
if err := b.image.AddLayerWithDiffID(bpLayerTar, diffID.String()); err != nil {
return errors.Wrapf(err,
"getting content hashes for buildpack %s",
"adding layer tar for buildpack %s",
style.Symbol(bp.Descriptor().Info.FullName()),
)
}
Expand Down

0 comments on commit 650ce05

Please sign in to comment.