Skip to content

Commit fdbab9f

Browse files
committed
Generate cri-o container runtime preload tarball
1 parent e8cebe0 commit fdbab9f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

hack/preload-images/generate.go

+8
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ func imagePullCommand(containerRuntime, img string) *exec.Cmd {
137137
if containerRuntime == "containerd" {
138138
return exec.Command("docker", "exec", profile, "sudo", "crictl", "pull", img)
139139
}
140+
141+
if containerRuntime == "cri-o" {
142+
return exec.Command("docker", "exec", profile, "sudo", "crictl", "pull", img)
143+
}
140144
return nil
141145
}
142146

@@ -154,6 +158,10 @@ func createImageTarball(tarballFilename, containerRuntime string) error {
154158
dirs = append(dirs, fmt.Sprintf("./lib/containerd"))
155159
}
156160

161+
if containerRuntime == "cri-o" {
162+
dirs = append(dirs, fmt.Sprintf("./lib/containers/storage"))
163+
}
164+
157165
args := []string{"exec", profile, "sudo", "tar", "-I", "lz4", "-C", "/var", "-cvf", tarballFilename}
158166
args = append(args, dirs...)
159167
cmd := exec.Command("docker", args...)

hack/preload-images/preload_images.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const (
3737

3838
var (
3939
dockerStorageDriver = "overlay2"
40-
containerRuntimes = []string{"docker", "containerd"}
40+
containerRuntimes = []string{"docker", "containerd", "cri-o"}
4141
k8sVersion string
4242
k8sVersions []string
4343
)

0 commit comments

Comments
 (0)