Include extended attributes in preload tarballs

pull/17829/head
Steven Powell 2023-12-18 14:00:03 -08:00
parent a3f4dc452d
commit 2d60f09ce8
4 changed files with 4 additions and 4 deletions

View File

@ -188,7 +188,7 @@ func createImageTarball(tarballFilename, containerRuntime string) error {
dirs = append(dirs, "./lib/containers")
}
args := []string{"exec", profile, "sudo", "tar", "-I", "lz4", "-C", "/var", "-cf", tarballFilename}
args := []string{"exec", profile, "sudo", "tar", "--xattrs", "--xattrs-include", "security.capability", "-I", "lz4", "-C", "/var", "-cf", tarballFilename}
args = append(args, dirs...)
cmd := exec.Command("docker", args...)
cmd.Stdout = os.Stdout

View File

@ -548,7 +548,7 @@ func (r *Containerd) Preload(cc config.ClusterConfig) error {
t = time.Now()
// extract the tarball to /var in the VM
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "--xattrs", "--xattrs-include", "security.capability", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
return errors.Wrapf(err, "extracting tarball: %s", rr.Output())
}
klog.Infof("Took %f seconds to extract the tarball", time.Since(t).Seconds())

View File

@ -445,7 +445,7 @@ func (r *CRIO) Preload(cc config.ClusterConfig) error {
t = time.Now()
// extract the tarball to /var in the VM
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "--xattrs", "--xattrs-include", "security.capability", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
return errors.Wrapf(err, "extracting tarball: %s", rr.Output())
}
klog.Infof("Took %f seconds to extract the tarball", time.Since(t).Seconds())

View File

@ -635,7 +635,7 @@ func (r *Docker) Preload(cc config.ClusterConfig) error {
klog.Infof("Took %f seconds to copy over tarball", time.Since(t).Seconds())
// extract the tarball to /var in the VM
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "--xattrs", "--xattrs-include", "security.capability", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil {
return errors.Wrapf(err, "extracting tarball: %s", rr.Output())
}