From a93c6a94fab2cff75a42d89adae2107097ddd6cf Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Thu, 23 Feb 2023 10:13:40 -0800 Subject: [PATCH] Fix apt-get exit code checking bug in tools/install_containerd.sh. We were not fetching the exit code of apt-get correctly in case of failure. PiperOrigin-RevId: 511818267 --- tools/install_containerd.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/install_containerd.sh b/tools/install_containerd.sh index b9742eedc..48bbe194c 100755 --- a/tools/install_containerd.sh +++ b/tools/install_containerd.sh @@ -77,13 +77,12 @@ readonly BTRFS_DEV # Install dependencies for the crictl tests. export DEBIAN_FRONTEND=noninteractive while true; do - if (apt-get update && apt-get install -y \ - "${BTRFS_DEV}" \ - libseccomp-dev); then - break - fi + apt-get update && apt-get install -y \ + "${BTRFS_DEV}" libseccomp-dev result=$? - if [[ $result -ne 100 ]]; then + if [[ $result -eq 0 ]]; then + break + elif [[ $result -ne 100 ]]; then exit $result fi done