Skip to content

Commit

Permalink
fix bug that gen layer tar contains deplicated files
Browse files Browse the repository at this point in the history
Signed-off-by: frankyang <[email protected]>
  • Loading branch information
yyb196 committed Nov 21, 2023
1 parent d5817ce commit f1ce51f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache/blobs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper
}
defer func() {
if cw != nil {
// after commit succ cw will be set to to nil, if cw isn't nil, error
// happened before commit, we should drop the content already written
cw.Truncate(0)
if cerr := cw.Close(); cerr != nil {
bklog.G(ctx).WithError(cerr).Warnf("failed to close writer %q", ref)
}
Expand Down

0 comments on commit f1ce51f

Please sign in to comment.