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
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
usage=$(az vm list-usage --location "$location" --query "[?name.value=='$family'] | [0]" -o json)
|
remaining=$(az vm list-usage --location "$location" --query "[?name.value=='$family'] | [0]" -o json |
|
||||||
current=$(echo "$usage" | jq -r '.currentValue')
|
jq '.limit + 0 - .currentValue >= $ARGS.positional[0]' --jsonargs "$vcpu")
|
||||||
limit=$(echo "$usage" | jq -r '.limit')
|
if [[ "$remaining" = true ]]; then
|
||||||
|
|
||||||
if [[ $((limit - current)) -ge $vcpu ]]; then
|
|
||||||
echo "Sufficient quota found in $location"
|
echo "Sufficient quota found in $location"
|
||||||
echo "location=$location" >> "$GITHUB_OUTPUT"
|
echo "location=$location" >> "$GITHUB_OUTPUT"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user