diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-06-07 15:48:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 15:48:36 -0400 |
commit | fef40e2ad384ec6e5e604b7e11e5cbb25ac7c304 (patch) | |
tree | 75ac9c7c375cb420432da7f79080e56b44e4de52 /libpod/container_internal_linux.go | |
parent | f459c197bdce6c6d6056c7214ce186f360599c94 (diff) | |
parent | 8533ea000459403a9a708fe01f875509ed22ffe1 (diff) | |
download | podman-fef40e2ad384ec6e5e604b7e11e5cbb25ac7c304.tar.gz podman-fef40e2ad384ec6e5e604b7e11e5cbb25ac7c304.tar.bz2 podman-fef40e2ad384ec6e5e604b7e11e5cbb25ac7c304.zip |
Merge pull request #14483 from jakecorrenti/restart-privelaged-containers-after-host-device-change
Privileged containers can now restart if the host devices change
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 0056b8e86..b298014df 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -438,6 +438,14 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { //nolint:staticcheck g := generate.NewFromSpec(c.config.Spec) + // If the flag to mount all devices is set for a privileged container, add + // all the devices from the host's machine into the container + if c.config.MountAllDevices { + if err := util.AddPrivilegedDevices(&g); err != nil { + return nil, err + } + } + // If network namespace was requested, add it now if c.config.CreateNetNS { if c.config.PostConfigureNetNS { |