mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/int/helpers: simplify set_cgroup_mount_writable
Use update_config like in all the other places. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -214,10 +214,8 @@ function set_resources_limit() {
|
||||
# Helper function to make /sys/fs/cgroup writable
|
||||
function set_cgroup_mount_writable() {
|
||||
bundle="${1:-.}"
|
||||
cat "$bundle/config.json" \
|
||||
| jq '.mounts |= map((select(.type == "cgroup") | .options -= ["ro"]) // .)' \
|
||||
>"$bundle/config.json.tmp"
|
||||
mv "$bundle/config.json"{.tmp,}
|
||||
update_config '.mounts |= map((select(.type == "cgroup") | .options -= ["ro"]) // .)' \
|
||||
$bundle
|
||||
}
|
||||
|
||||
# Fails the current test, providing the error given.
|
||||
|
||||
Reference in New Issue
Block a user