mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: Use jq instead of bash arithmetic
jq's arithmetic is much more robust. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Bo Chen
parent
dcdf16b8ff
commit
b8a61da06a
8
.github/workflows/mshv-infra.yaml
vendored
8
.github/workflows/mshv-infra.yaml
vendored
@@ -93,11 +93,9 @@ jobs:
|
||||
continue
|
||||
fi
|
||||
|
||||
usage=$(az vm list-usage --location "$location" --query "[?name.value=='$family'] | [0]" -o json)
|
||||
current=$(echo "$usage" | jq -r '.currentValue')
|
||||
limit=$(echo "$usage" | jq -r '.limit')
|
||||
|
||||
if [[ $((limit - current)) -ge $vcpu ]]; then
|
||||
remaining=$(az vm list-usage --location "$location" --query "[?name.value=='$family'] | [0]" -o json |
|
||||
jq '.limit + 0 - .currentValue >= $ARGS.positional[0]' --jsonargs "$vcpu")
|
||||
if [[ "$remaining" = true ]]; then
|
||||
echo "Sufficient quota found in $location"
|
||||
echo "location=$location" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user