mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-04-26 18:43:06 +00:00
tools: Fix shellcheck issues in build.sh
Address shellcheck warnings including proper variable quoting, use of [[ ]] over [ ], declaring and assigning variables separately, and adding appropriate shellcheck disable directives where needed. Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com> Made-with: Cursor
This commit is contained in:
@@ -16,6 +16,7 @@ source "${script_dir}/../../scripts/lib.sh"
|
||||
|
||||
|
||||
readonly busybox_builder="${script_dir}/build-static-busybox.sh"
|
||||
# shellcheck disable=SC2154
|
||||
readonly busybox_builddir="${repo_root_dir}/build/busybox/builddir"
|
||||
|
||||
busybox_version="$(get_from_kata_deps ".externals.busybox.version")"
|
||||
@@ -26,10 +27,12 @@ readonly BUSYBOX_URL="${busybox_url}"
|
||||
|
||||
|
||||
container_image="${BUSYBOX_CONTAINER_BUILDER:-$(get_busybox_image_name)}"
|
||||
[ "${CROSS_BUILD}" == "true" ] && container_image="${container_image}-cross-build"
|
||||
# shellcheck disable=SC2154
|
||||
[[ "${CROSS_BUILD}" == "true" ]] && container_image="${container_image}-cross-build"
|
||||
|
||||
# shellcheck disable=SC2154,SC2086
|
||||
docker pull "${container_image}" || \
|
||||
(docker $BUILDX build $PLATFORM \
|
||||
(docker ${BUILDX} build ${PLATFORM} \
|
||||
-t "${container_image}" "${script_dir}" \
|
||||
# No-op unless PUSH_TO_REGISTRY is exported as "yes"
|
||||
push_to_registry "${container_image}")
|
||||
|
||||
Reference in New Issue
Block a user