Skip to content

Commit

Permalink
defaulting to unbuffered reader for dmverity hashing (microsoft#1887)
Browse files Browse the repository at this point in the history
Signed-off-by: Seth Hollandsworth <sethho@microsoft.com>
Co-authored-by: ksayid <khalilsayid@microsoft.com>
(cherry picked from commit e7509cc)
  • Loading branch information
SethHollandsworth authored and anmaxvl committed Sep 14, 2023
1 parent 750e11b commit b20c4eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/dmverity-vhd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ func fetchImageLayers(ctx *cli.Context) (layers []v1.Layer, err error) {
// if only an image name is provided and not a tag, the default is "latest"
img, err = tarball.ImageFromPath(tarballPath, &imageNameAndTag)
} else if dockerDaemon {
img, err = daemon.Image(ref)
// use the unbuffered opener, the tradeoff being the image will stream as needed
// so it is slower but much more memory efficient
var opts []daemon.Option
opt := daemon.WithUnbufferedOpener()
opts = append(opts, opt)

img, err = daemon.Image(ref, opts...)
} else {
var remoteOpts []remote.Option
if ctx.IsSet(usernameFlag) && ctx.IsSet(passwordFlag) {
Expand Down

0 comments on commit b20c4eb

Please sign in to comment.