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

Commit 4a2db00

Browse files
committed
Do not overwrite the loaded tarball image
This commit makes sure that if the provided argument is a local tarfile, the loaded image into the `img` varible does not get overwritten by trying to fetch something from a remote registry.
1 parent 4350bef commit 4a2db00

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cmd/root.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ func getImageForName(imageName string) (pkgutil.Image, error) {
141141
}
142142
elapsed := time.Now().Sub(start)
143143
logrus.Infof("retrieving image from tar took %f seconds", elapsed.Seconds())
144-
}
145-
146-
if strings.HasPrefix(imageName, DaemonPrefix) {
144+
} else if strings.HasPrefix(imageName, DaemonPrefix) {
147145
// remove the daemon prefix
148146
imageName = strings.Replace(imageName, DaemonPrefix, "", -1)
149147

0 commit comments

Comments
 (0)