Many: replace 'which' with 'type -p' in test cases

Unfortunately, `which` does not seem to be installed by default on our
F41 CI images. Instead of doing the dance with rebuilds, which has been
problematic recently, let's not rely on `which` in scripts any more,
since we can replace it with the Bash built-in `type` command.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-01-23 09:15:03 +01:00 committed by Achilleas Koutsou
parent 55c22bf4df
commit 2bc27d2d85
13 changed files with 24 additions and 24 deletions

View file

@ -78,9 +78,9 @@ if [[ "$TEST_TYPE" == "$TEST_TYPE_CLOUD_UPLOAD" ]]; then
# Container image used for cloud provider CLI tools
export CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
if which podman 2>/dev/null >&2; then
if type -p podman 2>/dev/null >&2; then
export CONTAINER_RUNTIME=podman
elif which docker 2>/dev/null >&2; then
elif type -p docker 2>/dev/null >&2; then
export CONTAINER_RUNTIME=docker
else
echo No container runtime found, install podman or docker.