Fix the image cache delete

pull/2320/head
kairen 2017-12-14 00:05:56 +08:00 committed by dlorenc
parent 8f91c37bba
commit 50dcda4ba9
1 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,6 @@ limitations under the License.
package machine
import (
"golang.org/x/sync/errgroup"
"io/ioutil"
"os"
"os/exec"
@ -25,6 +24,8 @@ import (
"runtime"
"strings"
"golang.org/x/sync/errgroup"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/config"
@ -223,6 +224,7 @@ func LoadFromCacheBlocking(cmd bootstrapper.CommandRunner, src string) error {
func DeleteFromImageCacheDir(images []string) error {
for _, image := range images {
path := filepath.Join(constants.ImageCacheDir, image)
path = sanitizeCacheDir(path)
glog.Infoln("Deleting image in cache at ", path)
if err := os.Remove(path); err != nil {
return err