run preload on hot restarts as well, in case kubernetes version has been upgraded

pull/7210/head
Priya Wadhwa 2020-03-24 13:44:51 -07:00
parent 8d9e26d994
commit b5e088ad59
1 changed files with 10 additions and 5 deletions

View File

@ -524,17 +524,22 @@ func (k *Bootstrapper) UpdateCluster(cfg config.ClusterConfig) error {
return errors.Wrap(err, "kubeadm images")
}
if cfg.KubernetesConfig.ShouldLoadCachedImages {
if err := machine.LoadImages(&cfg, k.c, images, constants.ImageCacheDir); err != nil {
out.FailureT("Unable to load cached images: {{.error}}", out.V{"error": err})
}
}
r, err := cruntime.New(cruntime.Config{Type: cfg.KubernetesConfig.ContainerRuntime,
Runner: k.c, Socket: cfg.KubernetesConfig.CRISocket})
if err != nil {
return errors.Wrap(err, "runtime")
}
if err := r.Preload(cfg.KubernetesConfig); err != nil {
return errors.Wrap(err, "preloading")
}
if cfg.KubernetesConfig.ShouldLoadCachedImages {
if err := machine.LoadImages(&cfg, k.c, images, constants.ImageCacheDir); err != nil {
out.FailureT("Unable to load cached images: {{.error}}", out.V{"error": err})
}
}
for _, n := range cfg.Nodes {
err := k.UpdateNode(cfg, n, r)
if err != nil {