1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-16 06:59:25 +00:00

Add sandbox image to images to pre-pull

This commit is contained in:
Jake Hyde
2023-04-04 11:59:38 -04:00
parent 107c17d145
commit 4ca4b2e1ae

View File

@@ -1048,14 +1048,17 @@ func (c *Cluster) PrePullK8sImages(ctx context.Context) error {
var errgrp errgroup.Group
hostList := hosts.GetUniqueHostList(c.EtcdHosts, c.ControlPlaneHosts, c.WorkerHosts)
hostsQueue := util.GetObjectQueue(hostList)
imageList := []string{c.SystemImages.Kubernetes, c.Services.Kubelet.InfraContainerImage}
for w := 0; w < WorkerThreads; w++ {
errgrp.Go(func() error {
var errList []error
for host := range hostsQueue {
runHost := host.(*hosts.Host)
err := docker.UseLocalOrPull(ctx, runHost.DClient, runHost.Address, c.SystemImages.Kubernetes, "pre-deploy", c.PrivateRegistriesMap)
if err != nil {
errList = append(errList, err)
for _, image := range imageList {
err := docker.UseLocalOrPull(ctx, runHost.DClient, runHost.Address, image, "pre-deploy", c.PrivateRegistriesMap)
if err != nil {
errList = append(errList, err)
}
}
}
return util.ErrList(errList)