From 011609b9f48289df43696d004c1c97c7e18abf11 Mon Sep 17 00:00:00 2001 From: tripolkaandrey Date: Sat, 13 Mar 2021 20:46:05 +0200 Subject: [PATCH] improved error message when image does not exist --- pkg/minikube/image/cache.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/minikube/image/cache.go b/pkg/minikube/image/cache.go index 8157ab8a27c1..b02ac38d7e19 100644 --- a/pkg/minikube/image/cache.go +++ b/pkg/minikube/image/cache.go @@ -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)