fix: skip removing the ambassador container when it isn't running. Closes dokku/dokku-mongo#90

This commit is contained in:
Jose Diaz-Gonzalez
2017-08-27 18:55:25 -04:00
parent decc180ffc
commit 565fa86c3d

View File

@@ -412,8 +412,17 @@ service_port_pause() {
[[ ! -f "$PORT_FILE" ]] && return 0
fi
docker stop "$EXPOSED_NAME" > /dev/null
docker rm "$EXPOSED_NAME" > /dev/null
local CONTAINER_NAME=$(docker ps -f name=^/${EXPOSED_NAME}$ --format "{{.Names}}")
if [[ -z "$CONTAINER_NAME" ]]; then
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE unexposed"
fi
return
fi
docker stop "$EXPOSED_NAME" > /dev/null 2>&1 || true
docker rm "$EXPOSED_NAME" > /dev/null 2>&1 || true
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE unexposed"
fi