aboutsummaryrefslogtreecommitdiff
path: root/tools/validate-docker-execute.sh
diff options
context:
space:
mode:
authorMartin Hiner <m.hiner@partner.samsung.com>2022-11-21 18:38:57 +0100
committerMartin Hiner <m.hiner@partner.samsung.com>2023-04-28 16:16:55 +0200
commit53e8b80ed36a9193627862427fa224ed38375d3a (patch)
tree14463dda4a87452345c37a1a5252d50db057bc12 /tools/validate-docker-execute.sh
parent92ddbdfbc190ec430f5527fcf867efec97e455b4 (diff)
downloadkolla-ansible-53e8b80ed36a9193627862427fa224ed38375d3a.tar.gz
kolla-ansible-53e8b80ed36a9193627862427fa224ed38375d3a.zip
Add container engine option to scripts
This patch add a way to choose container engine inside tool and test scripts. This is in preparation for Podman introduction but still leaves Docker as default container engine. Signed-off-by: Martin Hiner <m.hiner@partner.samsung.com> Change-Id: I395d2bdb0dfb4b325b6ad197c8893c8a0f768324
Diffstat (limited to 'tools/validate-docker-execute.sh')
-rwxr-xr-xtools/validate-docker-execute.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/validate-docker-execute.sh b/tools/validate-docker-execute.sh
index 4db81e1e2..cca6589dd 100755
--- a/tools/validate-docker-execute.sh
+++ b/tools/validate-docker-execute.sh
@@ -1,13 +1,14 @@
#!/usr/bin/env bash
#
# This script can be used to check user privilege to execute
-# docker commands
+# docker or podman commands depending on CONTAINER_ENGINE
+# environment variable
function check_dockerexecute {
- sudo docker ps &>/dev/null
+ sudo $CONTAINER_ENGINE ps &>/dev/null
return_val=$?
if [ $return_val -ne 0 ]; then
- echo "User $USER can't seem to run Docker commands. Verify product documentation to allow user to execute docker commands" 1>&2
+ echo "User $USER can't seem to run ${CONTAINER_ENGINE^} commands. Verify product documentation to allow user to execute ${CONTAINER_ENGINE^} commands" 1>&2
exit 1
fi
}