Skip to content

Commit c3609ff

Browse files
committed
cri: filter selinux xattr for image volumes
Exclude the `security.selinux` xattr when copying content from layer storage for image volumes. This allows for the already correct label at the target location to be applied to the copied content, thus enabling containers to write to volumes that they implicitly expect to be able to write to. - Fixes containerd#5090 - See rancher/rke2#690 Signed-off-by: Jacob Blain Christen <[email protected]>
1 parent ff2e58d commit c3609ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cri/opts/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ func copyExistingContents(source, destination string) error {
115115
if len(dstList) != 0 {
116116
return errors.Errorf("volume at %q is not initially empty", destination)
117117
}
118-
return fs.CopyDir(destination, source)
118+
return fs.CopyDir(destination, source, fs.WithXAttrExclude("security.selinux"))
119119
}

0 commit comments

Comments
 (0)