Merge pull request #7456 from giuseppe/modprobe-fuse

spec: modprobe fuse with --device .*/fuse
This commit is contained in:
OpenShift Merge Robot
2020-10-02 07:53:37 -04:00
committed by GitHub
3 changed files with 15 additions and 0 deletions

View File

@ -215,6 +215,10 @@ Note: if the user only has access rights via a group, accessing the device
from inside a rootless container will fail. The **crun**(1) runtime offers a
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
Podman may load kernel modules required for using the specified
device. The devices that podman will load modules when necessary are:
/dev/fuse.
**--device-cgroup-rule**="type major:minor mode"
Add a rule to the cgroup allowed devices list. The rule is expected to be in the format specified in the Linux kernel documentation (Documentation/cgroup-v1/devices.txt):

View File

@ -231,6 +231,10 @@ Note: if the user only has access rights via a group, accessing the device
from inside a rootless container will fail. The **crun**(1) runtime offers a
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
Podman may load kernel modules required for using the specified
device. The devices that podman will load modules when necessary are:
/dev/fuse.
**--device-cgroup-rule**=rule
Add a rule to the cgroup allowed devices list

View File

@ -248,6 +248,13 @@ func addDevice(g *generate.Generator, device string) error {
}
g.Config.Mounts = append(g.Config.Mounts, devMnt)
return nil
} else if src == "/dev/fuse" {
// if the user is asking for fuse inside the container
// make sure the module is loaded.
f, err := unix.Open(src, unix.O_RDONLY|unix.O_NONBLOCK, 0)
if err == nil {
unix.Close(f)
}
}
dev.Path = dst
g.AddDevice(*dev)