fix: move container status exclusively to ps plugin

This information didn't belong in the apps plugin and was incomplete.

Also set the container status to dead when it is not detected as running.
This commit is contained in:
Jose Diaz-Gonzalez committed 2018-02-24 03:03:55 -05:00
1 parent 376284381e
commit cd674d3cb3
3 files changed
+3 -19

No files matched your search

+3 -1
View File
@@ -34,9 +34,11 @@ report_single_app() {
local DOKKU_APP_RESTORE=$(config_get "$APP" DOKKU_APP_RESTORE || true)
local STATUSES=()
if [[ "$DOKKU_APP_RESTORE" != 0 ]]; then RESTORE="true"; else RESTORE="false"; fi
local APP_CONTAINER_STATUS
for CONTAINER_FILE in $CONTAINER_FILES; do
CID=$(< "$DOKKU_ROOT/$APP/$CONTAINER_FILE")
local APP_CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID")
APP_CONTAINER_STATUS=$(docker inspect -f '{{.State.Running}}' "$CID" 2> /dev/null)
[[ -z "$APP_CONTAINER_STATUS" ]] && APP_CONTAINER_STATUS="dead"
STATUSES+=("${CONTAINER_FILE#*.}:$APP_CONTAINER_STATUS#${CID:0:12}")
done
local flag_map=(