Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 7a765e9

Browse files
committed
use different variable
1 parent 8376be8 commit 7a765e9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/root.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import (
4444
)
4545

4646
var json bool
47+
var isDaemon bool
4748

4849
var save bool
4950
var types diffTypes
@@ -161,8 +162,7 @@ func getImageForName(imageName string) (pkgutil.Image, error) {
161162
}
162163
elapsed := time.Now().Sub(start)
163164
logrus.Infof("retrieving image from daemon took %f seconds", elapsed.Seconds())
164-
// TODO(nkubala): remove this when we can set compression level in containerregistry
165-
noCache = true // force noCache if image is in daemon
165+
isDaemon = true
166166
} else {
167167
// either has remote prefix or has no prefix, in which case we force remote
168168
imageName = strings.Replace(imageName, RemotePrefix, "", -1)
@@ -232,7 +232,8 @@ func getImageForName(imageName string) (pkgutil.Image, error) {
232232
}
233233

234234
func getExtractPathForImage(imageName string, image v1.Image) (string, error) {
235-
if noCache {
235+
if isDaemon {
236+
// since we have to compress the image to get the digest, don't cache daemon images
236237
return getExtractPathForName(imageName)
237238
}
238239
start := time.Now()

0 commit comments

Comments
 (0)