From fdbab9f3cf7bb4c6d549ed387843f3aa8c16d3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 27 Jun 2020 13:15:36 +0200 Subject: [PATCH] Generate cri-o container runtime preload tarball --- hack/preload-images/generate.go | 8 ++++++++ hack/preload-images/preload_images.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hack/preload-images/generate.go b/hack/preload-images/generate.go index 572352cbe81b..9c1bdcfa3471 100644 --- a/hack/preload-images/generate.go +++ b/hack/preload-images/generate.go @@ -137,6 +137,10 @@ func imagePullCommand(containerRuntime, img string) *exec.Cmd { if containerRuntime == "containerd" { return exec.Command("docker", "exec", profile, "sudo", "crictl", "pull", img) } + + if containerRuntime == "cri-o" { + return exec.Command("docker", "exec", profile, "sudo", "crictl", "pull", img) + } return nil } @@ -154,6 +158,10 @@ func createImageTarball(tarballFilename, containerRuntime string) error { dirs = append(dirs, fmt.Sprintf("./lib/containerd")) } + if containerRuntime == "cri-o" { + dirs = append(dirs, fmt.Sprintf("./lib/containers/storage")) + } + args := []string{"exec", profile, "sudo", "tar", "-I", "lz4", "-C", "/var", "-cvf", tarballFilename} args = append(args, dirs...) cmd := exec.Command("docker", args...) diff --git a/hack/preload-images/preload_images.go b/hack/preload-images/preload_images.go index 09d62e421b4d..88a480d445f4 100644 --- a/hack/preload-images/preload_images.go +++ b/hack/preload-images/preload_images.go @@ -37,7 +37,7 @@ const ( var ( dockerStorageDriver = "overlay2" - containerRuntimes = []string{"docker", "containerd"} + containerRuntimes = []string{"docker", "containerd", "cri-o"} k8sVersion string k8sVersions []string )