Ignore errors when removing containers in DevStack
We don't really care if on unstack the containers doesn't exist, so this
commit makes us ignore those errors.
Closes-Bug:
@@ -16,11 +16,20 @@ XTRACE=$(set +o | grep xtrace)
set -o xtrace
function container_runtime {
+ # Ignore error at killing/removing a container doesn't running to avoid
+ # unstack is terminated.
+ # TODO: Support for CRI-O if it's required.
+ local regex_cmds_ignore="(kill|rm)\s+"
+
if [[ ${CONTAINER_ENGINE} == 'crio' ]]; then
sudo podman "$@" || die $LINENO "Error when running podman command"
+ else
+ if [[ $@ =~ $regex_cmds_ignore ]]; then
+ docker "$@"
else
docker "$@" || die $LINENO "Error when running docker command"
fi
+ fi
}
function create_kuryr_account {
