Skip to content

Commit

Permalink
docker compose ps json format has changed (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
basvandervlies authored Jan 3, 2024
1 parent 0c9e4ef commit d3b3aed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion promise-types/docker_compose/docker_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ do_evaluate() {

log debug "${LOG_PREFIX}:${request_promiser}"

docker_status=$(${docker_cmd} ps --format=json | jq -r '.[] | .Name + ":" + .State + ":" + .Health + ":" + .Service')
# format has been changed since version 2.21.0
docker_status=$(${docker_cmd} ps --format=json | jq -s '.[] | if type=="array" then . else [.] end' | jq -r '.[] | .Name + ":" + .State + ":" + .Health + ":" + .Service')
if [[ $? -ne 0 ]]
then
log error "${LOG_PREFIX}:query failed: ${docker_status}"
Expand Down

0 comments on commit d3b3aed

Please sign in to comment.