diff --git a/pkg/minikube/image/image.go b/pkg/minikube/image/image.go index 4650e4f89d..6817f3c05d 100644 --- a/pkg/minikube/image/image.go +++ b/pkg/minikube/image/image.go @@ -216,19 +216,25 @@ func retrieveImage(ref name.Reference) (v1.Image, error) { var err error var img v1.Image + if !useDaemon && !useRemote { + return nil, fmt.Errorf("neither daemon nor remote") + } + klog.Infof("retrieving image: %+v", ref) if useDaemon { img, err = retrieveDaemon(ref) + if err == nil { + return img, nil + } } if useRemote { img, err = retrieveRemote(ref, defaultPlatform) - if err != nil { - return nil, err + if err == nil { + return fixPlatform(ref, img, defaultPlatform) } - return fixPlatform(ref, img, defaultPlatform) } - return img, err + return nil, err } func retrieveDaemon(ref name.Reference) (v1.Image, error) {