From e6c5a64e0af93ef516d25fd9e499fb91b3c5c6eb Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Fri, 7 Jul 2023 20:16:48 +0200 Subject: [PATCH] kola: Skip devcontainer test if not available The test will fail on external PRs or locally built images because the devcontainer can't be downloaded. Skip the test if the download has no chance to succeed. --- kola/tests/util/devcontainer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kola/tests/util/devcontainer.go b/kola/tests/util/devcontainer.go index 2fd418f9d..916298a82 100644 --- a/kola/tests/util/devcontainer.go +++ b/kola/tests/util/devcontainer.go @@ -64,6 +64,11 @@ function download_dev_container_image { version=$(source /usr/share/flatcar/release; echo "${FLATCAR_RELEASE_VERSION}") image_url=$(process_template '{{ .ImageDirectoryURLTemplate }}/flatcar_developer_container.bin.bz2' "${arch}" "${version}") + if [ "$(curl -I --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 -L -s -o /dev/null -w "%{http_code}" "${image_url}")" = 404 ]; then + echo "Skipping test because the devcontainer is not available" >&2 + exit 0 + fi + echo "Fetching developer container from ${image_url}" # Stolen from copy_from_buildcache in ci_automation_common.sh. Not # using --output-dir option as this seems to be quite a new addition