mirror of https://github.com/containers/podman.git
				
				
				
			specgen: honor --device-cgroup-rule with a new user namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
		
							parent
							
								
									0220f33384
								
							
						
					
					
						commit
						227c07aebc
					
				|  | @ -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) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue