mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
specgen: honor --device-cgroup-rule with a new user namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -258,7 +258,7 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
|
|||||||
if isRootless && len(s.DeviceCgroupRule) > 0 {
|
if isRootless && len(s.DeviceCgroupRule) > 0 {
|
||||||
return nil, fmt.Errorf("device cgroup rules are not supported in rootless mode or in a user namespace")
|
return nil, fmt.Errorf("device cgroup rules are not supported in rootless mode or in a user namespace")
|
||||||
}
|
}
|
||||||
if !inUserNS && !s.Privileged {
|
if !isRootless && !s.Privileged {
|
||||||
for _, dev := range s.DeviceCgroupRule {
|
for _, dev := range s.DeviceCgroupRule {
|
||||||
g.AddLinuxResourcesDevice(true, dev.Type, dev.Major, dev.Minor, dev.Access)
|
g.AddLinuxResourcesDevice(true, dev.Type, dev.Major, dev.Minor, dev.Access)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user