Skip to content

Commit

Permalink
improved error message when image does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tripolkaandrey committed Mar 13, 2021
1 parent ff0e25a commit 011609b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/minikube/image/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ func SaveToDir(images []string, cacheDir string) error {
dst := filepath.Join(cacheDir, image)
dst = localpath.SanitizeCacheDir(dst)
if err := saveToTarFile(image, dst); err != nil {
klog.Errorf("save image to file %q -> %q failed: %v", image, dst, err)
klog.Errorf("save image to file %q -> %q failed: \n" +
"The image you're trying to add to the cache doesn't exist " +
"locally on your machine: try to build or to pull it first",
image, dst)

return errors.Wrapf(err, "caching image %q", dst)
}
klog.Infof("save to tar file %s -> %s succeeded", image, dst)
Expand Down

0 comments on commit 011609b

Please sign in to comment.