summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-30 08:39:12 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-05-01 15:00:26 -0400
commit730fbc76284fd14749863ee160e6548577e7b180 (patch)
tree636a8ab33704fb47cdc7ec3836f87821ec6cfb85
parenta451048efc67d404d4af934757179819106d9d22 (diff)
downloadpodman-730fbc76284fd14749863ee160e6548577e7b180.tar.gz
podman-730fbc76284fd14749863ee160e6548577e7b180.tar.bz2
podman-730fbc76284fd14749863ee160e6548577e7b180.zip
Properly handle containers.conf devices
We need to add the default devices listed in containers.conf Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
-rw-r--r--pkg/specgen/generate/oci.go7
-rw-r--r--test/e2e/config/containers.conf2
2 files changed, 8 insertions, 1 deletions
diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go
index 7993777fb..c70141109 100644
--- a/pkg/specgen/generate/oci.go
+++ b/pkg/specgen/generate/oci.go
@@ -267,6 +267,13 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
return nil, err
}
} else {
+ // add default devices from containers.conf
+ for _, device := range rtc.Containers.Devices {
+ if err := DevicesFromPath(&g, device); err != nil {
+ return nil, err
+ }
+ }
+ // add default devices specified by caller
for _, device := range s.Devices {
if err := DevicesFromPath(&g, device.Path); err != nil {
return nil, err
diff --git a/test/e2e/config/containers.conf b/test/e2e/config/containers.conf
index 55d18f5e8..a3bdde786 100644
--- a/test/e2e/config/containers.conf
+++ b/test/e2e/config/containers.conf
@@ -38,7 +38,7 @@ shm_size = "201k"
# If it is empty or commented out, only the default devices will be used
#
devices = [
- "/dev/zero:/dev/notone,rwm",
+ "/dev/zero:/dev/notone:rwm",
]
default_sysctls = [