Skip to content

Commit

Permalink
Allow both tag and digest, for the cache images
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Mar 18, 2019
1 parent 1e0b5d4 commit 922ae92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/minikube/machine/cache_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ func CacheImage(image, dst string) error {
return errors.Wrapf(err, "making cache image directory: %s", dst)
}

tag, err := name.NewTag(image, name.WeakValidation)
ref, err := name.ParseReference(image, name.WeakValidation)
if err != nil {
return errors.Wrap(err, "creating docker image name")
}

img, err := remote.Image(tag, remote.WithAuthFromKeychain(authn.DefaultKeychain))
img, err := remote.Image(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain))
if err != nil {
return errors.Wrap(err, "fetching remote image")
}
Expand All @@ -313,5 +313,5 @@ func CacheImage(image, dst string) error {
return err
}
defer f.Close()
return tarball.Write(tag, img, f)
return tarball.Write(ref, img, f)
}

0 comments on commit 922ae92

Please sign in to comment.