Skip to content

Commit a7e8c52

Browse files
committed
Fixing out of memory with Usage:
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
1 parent c7723b4 commit a7e8c52

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

pkg/buildpack/buildpack.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,9 @@ func toNLayerTar(origID, origVersion string, firstHeader *tar.Header, tr *tar.Re
446446
return fmt.Errorf("failed to write header for '%s': %w", header.Name, err)
447447
}
448448

449-
buf, err := io.ReadAll(tr)
449+
_, err = io.Copy(mt.writer, tr)
450450
if err != nil {
451-
return fmt.Errorf("failed to read contents of '%s': %w", header.Name, err)
452-
}
453-
454-
_, err = mt.writer.Write(buf)
455-
if err != nil {
456-
return fmt.Errorf("failed to write contents to '%s': %w", header.Name, err)
451+
return errors.Wrapf(err, "failed to write contents to '%s'", header.Name)
457452
}
458453
}
459454
}

0 commit comments

Comments
 (0)