mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 00:00:23 +00:00
ci: allow CONTAINER_CMD prefixed with sudo
Allow passing: $ CONTAINER_CMD="sudo docker" ./scripts/minikube.sh cephcsi or $ CONTAINER_CMD="sudo podman" ./scripts/minikube.sh cephcsi Because the container images could list in '# sudo docker images' or '# sudo podman images' incase if the Makefile target image-cephcsi is run with sudo Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
parent
6fa7b74138
commit
bddf395eba
@ -97,13 +97,14 @@ function install_kubectl() {
|
||||
}
|
||||
|
||||
function validate_container_cmd() {
|
||||
if [[ "${CONTAINER_CMD}" == "docker" ]] || [[ "${CONTAINER_CMD}" == "podman" ]]; then
|
||||
if ! command -v "${CONTAINER_CMD}" &> /dev/null; then
|
||||
echo "'${CONTAINER_CMD}' not found"
|
||||
local cmd="${CONTAINER_CMD##* }"
|
||||
if [[ "${cmd}" == "docker" ]] || [[ "${cmd}" == "podman" ]]; then
|
||||
if ! command -v "${cmd}" &> /dev/null; then
|
||||
echo "'${cmd}' not found"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "'CONTAINER_CMD' should be either docker or podman and not '${CONTAINER_CMD}'"
|
||||
echo "'CONTAINER_CMD' should be either docker or podman and not '${cmd}'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user