tools: Fix shellcheck issues in kata-debug-build-and-upload-payload.sh

Fix shellcheck warnings and notes identified by running
shellcheck --severity=style.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
This commit is contained in:
Fabiano Fidêncio
2026-04-21 18:38:03 +02:00
parent cf1b4f69b4
commit 5b76b61213

View File

@@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#
[ -z "${DEBUG}" ] || set -x
[[ -z "${DEBUG}" ]] || set -x
set -o errexit
set -o nounset
set -o pipefail
@@ -17,26 +17,26 @@ REGISTRY="${1:-"quay.io/kata-containers/kata-debug"}"
TAG="${2:-}"
arch=$(uname -m)
[ "$arch" = "x86_64" ] && arch="amd64"
[[ "${arch}" = "x86_64" ]] && arch="amd64"
IMAGE_TAG="${REGISTRY}:$(git rev-parse HEAD)-${arch}"
pushd ${KATA_DEBUG_DIR}
pushd "${KATA_DEBUG_DIR}"
echo "Building the image"
docker build --tag ${IMAGE_TAG} .
docker build --tag "${IMAGE_TAG}" .
echo "Pushing the image to the registry"
docker push ${IMAGE_TAG}
docker push "${IMAGE_TAG}"
if [ -n "${TAG}" ]; then
if [[ -n "${TAG}" ]]; then
ADDITIONAL_TAG="${REGISTRY}:${TAG}"
echo "Building the ${ADDITIONAL_TAG} image"
docker build --tag ${ADDITIONAL_TAG} .
docker build --tag "${ADDITIONAL_TAG}" .
echo "Pushing the image ${ADDITIONAL_TAG} to the registry"
docker push ${ADDITIONAL_TAG}
docker push "${ADDITIONAL_TAG}"
fi
popd