Skip to content

Commit f9ef43e

Browse files
committed
check size of preload
1 parent 1353c3c commit f9ef43e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/minikube/download/preload.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func PreloadExists(k8sVersion, containerRuntime, driverName string, forcePreload
144144

145145
// Omit remote check if tarball exists locally
146146
targetPath := TarballPath(k8sVersion, containerRuntime)
147-
if _, err := checkCache(targetPath); err == nil {
147+
if f, err := checkCache(targetPath); err == nil && f.Size() != 0 {
148148
klog.Infof("Found local preload: %s", targetPath)
149149
setPreloadState(k8sVersion, containerRuntime, true)
150150
return true
@@ -170,7 +170,7 @@ func Preload(k8sVersion, containerRuntime, driverName string) error {
170170
return err
171171
}
172172

173-
if _, err := checkCache(targetPath); err == nil {
173+
if f, err := checkCache(targetPath); err == nil && f.Size() != 0 {
174174
klog.Infof("Found %s in cache, skipping download", targetPath)
175175
return nil
176176
}

0 commit comments

Comments
 (0)