Merge pull request #7872 from kubernetes/hush-puppies-34
Skip CacheAndLoadImages if no images are specified, silence status errorspull/7858/head
commit
6bed90c42f
|
@ -158,6 +158,10 @@ func needsTransfer(imgClient *client.Client, imgName string, cr cruntime.Manager
|
||||||
|
|
||||||
// CacheAndLoadImages caches and loads images to all profiles
|
// CacheAndLoadImages caches and loads images to all profiles
|
||||||
func CacheAndLoadImages(images []string) error {
|
func CacheAndLoadImages(images []string) error {
|
||||||
|
if len(images) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// This is the most important thing
|
// This is the most important thing
|
||||||
if err := image.SaveToDir(images, constants.ImageCacheDir); err != nil {
|
if err := image.SaveToDir(images, constants.ImageCacheDir); err != nil {
|
||||||
return errors.Wrap(err, "save to dir")
|
return errors.Wrap(err, "save to dir")
|
||||||
|
@ -192,7 +196,7 @@ func CacheAndLoadImages(images []string) error {
|
||||||
|
|
||||||
status, err := Status(api, m)
|
status, err := Status(api, m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("error getting status for %s: %v", pName, err)
|
glog.Warningf("error getting status for %s: %v", pName, err)
|
||||||
failed = append(failed, pName)
|
failed = append(failed, pName)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -200,7 +204,7 @@ func CacheAndLoadImages(images []string) error {
|
||||||
if status == state.Running.String() { // the not running hosts will load on next start
|
if status == state.Running.String() { // the not running hosts will load on next start
|
||||||
h, err := api.Load(m)
|
h, err := api.Load(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Failed to load machine %q: %v", m, err)
|
glog.Warningf("Failed to load machine %q: %v", m, err)
|
||||||
failed = append(failed, pName)
|
failed = append(failed, pName)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ var stderrWhitelist = []string{
|
||||||
`kubectl`,
|
`kubectl`,
|
||||||
// slow docker warning
|
// slow docker warning
|
||||||
`slow|long time|Restarting the docker service may improve`,
|
`slow|long time|Restarting the docker service may improve`,
|
||||||
|
// don't care if we can't push images to other profiles
|
||||||
|
`cache_images.go:.*error getting status`,
|
||||||
}
|
}
|
||||||
|
|
||||||
// stderrWhitelistRe combines rootCauses into a single regex
|
// stderrWhitelistRe combines rootCauses into a single regex
|
||||||
|
|
Loading…
Reference in New Issue