Merge pull request #3996 from tstromberg/cache-err-compare

Fix reversed err comparison and improve logging
pull/3998/head
Thomas Strömberg 2019-03-27 06:26:26 -07:00 committed by GitHub
commit 414a286f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -98,6 +98,7 @@ func LoadImages(cmd bootstrapper.CommandRunner, images []string, cacheDir string
src := filepath.Join(cacheDir, image)
src = sanitizeCacheDir(src)
if err := loadImageFromCache(cmd, cc.KubernetesConfig, src); err != nil {
glog.Warningf("Failed to load %s: %v", src, err)
return errors.Wrapf(err, "loading image %s", src)
}
return nil
@ -200,9 +201,9 @@ func getWindowsVolumeNameCmd(d string) (string, error) {
// loadImageFromCache loads a single image from the cache
func loadImageFromCache(cr bootstrapper.CommandRunner, k8s config.KubernetesConfig, src string) error {
glog.Infoln("Loading image from cache at ", src)
glog.Infof("Loading image from cache: %s", src)
filename := filepath.Base(src)
if _, err := os.Stat(src); err == nil {
if _, err := os.Stat(src); err != nil {
return err
}
dst := path.Join(tempLoadDir, filename)