Skip to content

Commit 9d6528c

Browse files
smukherj1rbe-toolchains-pr-bot
authored andcommitted
Implement UncompressedSize to take advantage of memory opt (#1377)
1 parent 35fde0f commit 9d6528c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

container/go/pkg/compat/image.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ func (l *fullLayer) Uncompressed() (io.ReadCloser, error) {
7575
return f, nil
7676
}
7777

78+
// UncompressedSize returns the size of the uncompressed layer contents.
79+
func (l *fullLayer) UncompressedSize() (int64, error) {
80+
f, err := os.Stat(l.uncompressedTarball)
81+
if err != nil {
82+
return 0, errors.Wrapf(err, "unable to stat %s to determine size of uncompressed layer", l.uncompressedTarball)
83+
}
84+
return f.Size(), nil
85+
}
86+
7887
// Size returns the compressed size of the Layer.
7988
func (l *fullLayer) Size() (int64, error) {
8089
f, err := os.Stat(l.compressedTarball)

repositories/go_repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def go_deps():
3737
if "com_github_google_go_containerregistry" not in excludes:
3838
go_repository(
3939
name = "com_github_google_go_containerregistry",
40-
commit = "b02f5c5c90539d88cec4eb4450c3d6f135457942",
40+
commit = "379933c9c22b8ff1b396b5b7f4ec322d27f0a206",
4141
importpath = "github.com/google/go-containerregistry",
4242
)
4343
if "com_github_pkg_errors" not in excludes:

0 commit comments

Comments
 (0)