mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Make BuildKite's docker runtime reload logic robust against empty runtime dict
PiperOrigin-RevId: 479678511
This commit is contained in:
committed by
gVisor bot
parent
36ddd3050c
commit
66aa0427cd
@@ -77,8 +77,11 @@ done
|
||||
set -euo pipefail
|
||||
|
||||
# Remove all Docker runtimes that may be installed.
|
||||
if grep -qE runtimes /etc/docker/daemon.json; then
|
||||
cat /etc/docker/daemon.json | jq 'del(.runtimes) + {runtimes: {}}' \
|
||||
num_docker_runtimes="$(jq \
|
||||
'(if has("runtimes") then .runtimes else {} end) | length' \
|
||||
< /etc/docker/daemon.json)"
|
||||
if [[ "$num_docker_runtimes" -gt 0 ]]; then
|
||||
cat /etc/docker/daemon.json | jq 'del(.runtimes)' \
|
||||
| sudo tee /etc/docker/daemon.json.tmp
|
||||
sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json
|
||||
bash -c "$DOCKER_RELOAD_COMMAND"
|
||||
|
||||
Reference in New Issue
Block a user