summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-02-06 17:24:29 -0500
committerQi Wang <qiwan@redhat.com>2020-02-12 14:30:23 -0500
commitd3260738d330b6141fec5f11f1a3a91f40365018 (patch)
treedf94d30ee7181164b9582fc8f162cb8ca4b74301 /pkg/spec/spec.go
parent4bdfeed5bf9c467c8ab53b392747ec722505b179 (diff)
downloadpodman-d3260738d330b6141fec5f11f1a3a91f40365018.tar.gz
podman-d3260738d330b6141fec5f11f1a3a91f40365018.tar.bz2
podman-d3260738d330b6141fec5f11f1a3a91f40365018.zip
support device-cgroup-rule
fix #4876 Add `--device-cgroup-rule` to podman create and run. This enables to add device rules after the container has been created. Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'pkg/spec/spec.go')
-rw-r--r--pkg/spec/spec.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index cae055bb0..b2a152a2d 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -232,6 +232,12 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
return nil, err
}
}
+ if len(config.Resources.DeviceCgroupRules) != 0 {
+ if err := deviceCgroupRules(&g, config.Resources.DeviceCgroupRules); err != nil {
+ return nil, err
+ }
+ addedResources = true
+ }
}
// SECURITY OPTS