Skip to content

Commit

Permalink
Fix another null exit case (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored Aug 25, 2021
1 parent 8503b74 commit 4e15142
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ else
echo "Warning: init container failed with exit code $init_container_status, this usually indicates plugin misconfiguration or infrastructure failure"
status="$init_container_status"
else
status="$(echo "$pod_json" | jq ".status.containerStatuses[0].state.terminated.exitCode")"
if container_status="$(echo "$pod_json" | jq -e ".status.containerStatuses[0].state.terminated.exitCode")"; then
status=$container_status
fi
fi
elif [[ "$pod_json" == *NotFound* ]]; then
echo "Warning: pod not found"
Expand Down

0 comments on commit 4e15142

Please sign in to comment.