Skip to content

Commit

Permalink
Update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Nov 25, 2024
1 parent dd47622 commit f9ef797
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rootfs/promstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ "${1}" == "install" ]]; then
DOCKER_STACK_DEPLOY_ARGS=""
# If the 'promstack' stack is already deployed, we want to use the --resolve-image=never flag
if docker stack ls --format "{{.Name}}" | grep promstack >/dev/null; then
entrypoint_log "$ME: The 'promstack' stack is already deployed, using --resolve-image=never flag to prevent image resolution."
entrypoint_log "$ME: The promstack stack is already deployed, using --resolve-image=never flag to prevent image resolution."
DOCKER_STACK_DEPLOY_ARGS="--resolve-image=never"
fi

Expand Down Expand Up @@ -86,7 +86,7 @@ if [[ "${1}" == "install" ]]; then
}
elif [[ "${1}" == "upgrade" ]]; then
if ! docker stack ls --format "{{.Name}}" | grep promstack >/dev/null; then
entrypoint_log "$ME: The 'promstack' stack is not deployed."
entrypoint_log "$ME: The promstack is not deployed."
entrypoint_log "$ME: You must deploy the 'promstack' stack before you can upgrade it."
exit 1
fi
Expand Down Expand Up @@ -115,14 +115,14 @@ elif [[ "${1}" == "upgrade" ]]; then
entrypoint_log "$ME: - Prometheus: http://${DOCKER_NODE_IP}:9090"
}
elif [[ "${1}" == "uninstall" ]]; then
entrypoint_log "$ME: Attempting to remove the 'promstack' stack..."
entrypoint_log "$ME: Attempting to remove the promstack..."
if docker stack ls --format "{{.Name}}" | grep promstack >/dev/null; then
docker stack rm promstack && {
echo "$ME: Grace period to allow services to shutdown..."
sleep 15
}
else
entrypoint_log "$ME: The 'promstack' stack is not deployed."
entrypoint_log "$ME: The promstack is not deployed."
fi

if docker network rm prometheus >/dev/null 2>&1; then
Expand All @@ -138,7 +138,7 @@ elif [[ "${1}" == "uninstall" ]]; then
fi

entrypoint_log "$ME:"
entrypoint_log "$ME: The removal is complete, the 'promstack' stack and associated networks have been removed."
entrypoint_log "$ME: The removal is complete, the promstack and associated networks have been removed."
entrypoint_log "$ME: It may take a while for all services to be completely removed."
else
entrypoint_log "$ME: Unknown command: ${1}"
Expand Down

0 comments on commit f9ef797

Please sign in to comment.