Skip to content
Snippets Groups Projects
Commit 5a7d24a6 authored by Jan David Mol's avatar Jan David Mol
Browse files

Don't have jq break on allocations without any tasks

parent f519d2fb
Branches
Tags
No related merge requests found
...@@ -126,9 +126,7 @@ function cleanup { ...@@ -126,9 +126,7 @@ function cleanup {
mkdir -p log/allocations mkdir -p log/allocations
# obtain the list of tasks, but only those that have actually started. # obtain the list of tasks, but only those that have actually started.
echo "Allocations:" docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc status -json | jq --raw-output '.[] | (.ID + " " + .Name + " " + (.TaskStates | objects | map_values(select(.StartedAt)) | keys[]) + " " + (.CreateTime/1e9 | todate))' | while read -r line
docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc status -json
docker exec server.station.nomad.nomad-cluster.jumppad.dev nomad alloc status -json | jq --raw-output '.[] | (.ID + " " + .Name + " " + (.TaskStates | map_values(select(.StartedAt)) | keys[]) + " " + (.CreateTime/1e9 | todate))' | while read -r line
do do
read -r -a parts <<< "${line}" read -r -a parts <<< "${line}"
ALLOC_ID="${parts[0]}" ALLOC_ID="${parts[0]}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment