Skip to content

Commit

Permalink
Generate cri-o container runtime preload tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Jun 27, 2020
1 parent e8cebe0 commit fdbab9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions hack/preload-images/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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...)
Expand Down
2 changes: 1 addition & 1 deletion hack/preload-images/preload_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (

var (
dockerStorageDriver = "overlay2"
containerRuntimes = []string{"docker", "containerd"}
containerRuntimes = []string{"docker", "containerd", "cri-o"}
k8sVersion string
k8sVersions []string
)
Expand Down

0 comments on commit fdbab9f

Please sign in to comment.