From dc9f2c24f14e636a6645769c488035f2c280534d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 15 Sep 2023 12:34:30 +0200 Subject: [PATCH] ci: cache: Check the sha256sum of the component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've removed this in the part 2 of this effort, as we were not caching the sha256sum of the component. Now that this part has been merged, let's get back to checking it. Fixes: #7834 -- part 3 Signed-off-by: Fabiano FidĂȘncio (cherry picked from commit 86c41074b403d092a532ae539010c024c7368c55) --- .../kata-deploy/local-build/kata-deploy-binaries.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index fc23a46552..7bd938fdc8 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -111,6 +111,11 @@ EOF exit "${return_code}" } +cleanup_and_fail() { + rm -f "${component_tarball_name}" + return 1 +} + install_cached_tarball_component() { if [ "${USE_CACHE}" != "yes" ]; then return 1 @@ -132,6 +137,7 @@ install_cached_tarball_component() { [ "${cached_image_version}" != "${current_image_version}" ] && return 1 [ "${cached_version}" != "${current_version}" ] && return 1 + sha256sum -c "${component}-sha256sum" || return $(cleanup_and_fail) info "Using cached tarball of ${component}" mv "${component_tarball_name}" "${component_tarball_path}"