When executed inside a container, the following code
selinux.Chcon("/mps/nvidia.com/gpu/pipe", "container_file_t", true)
fails for me with
lsetxattr /mps/nvidia.com/gpu/pipe: invalid argument
However, this code runs without errors and successfully updates the SELinux type:
import "os/exec"
output, err := chconCmd.CombinedOutput()
if err != nil {
klog.Errorf("\n%v", string(output))
return err
}
chconCmd := exec.Command("chcon", "-R", "-t", "container_file_t", "/mps/nvidia.com/gpu/pipe")
The container is running privileged on OpenShift (RHCOS).
When executed inside a container, the following code
fails for me with
lsetxattr /mps/nvidia.com/gpu/pipe: invalid argumentHowever, this code runs without errors and successfully updates the SELinux type:
The container is running privileged on OpenShift (RHCOS).