From cac41495cf3bfe4ae716ec31387d6a092633d0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 9 May 2020 18:36:56 +0200 Subject: [PATCH] Don't run the extraction tar container for podman The preloaded images will be extracted anyway, using ssh. But if creating them on the volume before the container is booted, means that /var will not be fully copied over to it. And without /var/lib/dpkg and others, kicbase will not boot. So skip the parallel extraction for podman, do it afterwards. Probably shouldn't mount all of /var, but just a sub-set... --- pkg/drivers/kic/kic.go | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/pkg/drivers/kic/kic.go b/pkg/drivers/kic/kic.go index 257e78cba067..5ff3262f4534 100644 --- a/pkg/drivers/kic/kic.go +++ b/pkg/drivers/kic/kic.go @@ -122,22 +122,27 @@ func (d *Driver) Create() error { } var waitForPreload sync.WaitGroup - waitForPreload.Add(1) - go func() { - defer waitForPreload.Done() - // If preload doesn't exist, don't bother extracting tarball to volume - if !download.PreloadExists(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime) { - return - } - t := time.Now() - glog.Infof("Starting extracting preloaded images to volume ...") - // Extract preloaded images to container - if err := oci.ExtractTarballToVolume(d.NodeConfig.OCIBinary, download.TarballPath(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime), params.Name, BaseImage); err != nil { - glog.Infof("Unable to extract preloaded tarball to volume: %v", err) - } else { - glog.Infof("duration metric: took %f seconds to extract preloaded images to volume", time.Since(t).Seconds()) - } - }() + if d.NodeConfig.OCIBinary == oci.Docker { + waitForPreload.Add(1) + go func() { + defer waitForPreload.Done() + // If preload doesn't exist, don't bother extracting tarball to volume + if !download.PreloadExists(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime) { + return + } + t := time.Now() + glog.Infof("Starting extracting preloaded images to volume ...") + // Extract preloaded images to container + if err := oci.ExtractTarballToVolume(d.NodeConfig.OCIBinary, download.TarballPath(d.NodeConfig.KubernetesVersion, d.NodeConfig.ContainerRuntime), params.Name, BaseImage); err != nil { + glog.Infof("Unable to extract preloaded tarball to volume: %v", err) + } else { + glog.Infof("duration metric: took %f seconds to extract preloaded images to volume", time.Since(t).Seconds()) + } + }() + } else { + // driver == "podman" + glog.Info("Driver isn't docker, skipping extracting preloaded images") + } if err := oci.CreateContainerNode(params); err != nil { return errors.Wrap(err, "create kic node")