[bug] Fix regression when use_podman=false

A regression was introduced by I970c1b91254d2a375192420a9169f3a629c56ce7
which means that deployments where use_podman is unspecified or false
fail because `podman image inspect` is not scoped by this check.

Story: 2007001
Task: 38844

Change-Id: I6a08312693caf8a52174a1ff199d205d54076ee9
Signed-off-by: Bharat Kunwar <brtknr@bath.edu>
This commit is contained in:
Bharat Kunwar 2020-02-21 12:13:45 +00:00
parent fa45002e21
commit 95abb45dca
No known key found for this signature in database
GPG Key ID: BD9EE5A336F305B9
1 changed files with 6 additions and 4 deletions

View File

@ -37,8 +37,10 @@ do
sleep 5s
done
KUBE_DIGEST=$($ssh_cmd podman image inspect hyperkube:${KUBE_TAG} --format "{{.Digest}}")
if [ -n "${KUBE_IMAGE_DIGEST}" ] && [ "${KUBE_IMAGE_DIGEST}" != "${KUBE_DIGEST}" ]; then
printf "The sha256 ${KUBE_DIGEST} of current hyperkube image cannot match the given one: ${KUBE_IMAGE_DIGEST}."
exit 1
if [ "$(echo $USE_PODMAN | tr '[:upper:]' '[:lower:]')" == "true" ]; then
KUBE_DIGEST=$($ssh_cmd podman image inspect hyperkube:${KUBE_TAG} --format "{{.Digest}}")
if [ -n "${KUBE_IMAGE_DIGEST}" ] && [ "${KUBE_IMAGE_DIGEST}" != "${KUBE_DIGEST}" ]; then
printf "The sha256 ${KUBE_DIGEST} of current hyperkube image cannot match the given one: ${KUBE_IMAGE_DIGEST}."
exit 1
fi
fi