From eb3866c636dd7d5b5b91ec110f65c67c9401a242 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 10 Apr 2018 20:21:25 -0400 Subject: [PATCH] fix: re-add is_container_running As this was not strictly announced in our migration guide, removing it is a bc-incompatible change we are not comfortable with. We may wish to remove it in the future --- plugins/common/functions | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/common/functions b/plugins/common/functions index 725a3eae2..6045babf2 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -398,6 +398,19 @@ is_deployed() { fi } +is_container_running() { + declare desc="return 0 if given docker container id is in running state" + declare deprecated=true + local CID=$1 + local CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" || true) + + if [[ "$CONTAINER_STATUS" == "true" ]]; then + return 0 + else + return 1 + fi +} + is_container_status() { declare desc="return 0 if given docker container id is in given state" local CID=$1