Skip to content

Commit

Permalink
ci-automation: fix local image detection for nightly SDKs
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Fromm <[email protected]>
  • Loading branch information
t-lo committed Oct 20, 2023
1 parent 5f40cb5 commit 4dc20d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ci-automation/ci_automation_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,16 @@ function docker_image_from_buildcache() {
local id_file_url="https://${BUILDCACHE_SERVER}/containers/${version}/${id_file}"
local id_file_url_release="https://mirror.release.flatcar-linux.net/containers/${version}/${id_file}"

if image_exists_locally "${name}" "${version}" ; then
local local_image=""
if image_exists_locally "/${name}" "${version}" ; then
local_image="${name}:${version}"
elif image_exists_locally "${CONTAINER_REGISTRY}/${name}" "${version}" ; then
local_image="${CONTAINER_REGISTRY}/${name}:${version}"
fi

if [[ -n "${local_image}" ]] ; then
local image_id=""
image_id=$($docker image inspect "${name}:${version}" | jq -r '.[].Id' | sed 's/^sha256://')
image_id=$($docker image inspect "${local_image}" | jq -r '.[].Id' | sed 's/^sha256://')
local remote_id=""
remote_id=$(curl --fail --silent --show-error --location --retry-delay 1 \
--retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 \
Expand Down

0 comments on commit 4dc20d5

Please sign in to comment.