Skip to content

Commit bcc4331

Browse files
authored
Merge pull request #3305 from kairveeehh/master
added the yq check to test-template
2 parents 47ace06 + 38e645d commit bcc4331

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

hack/test-templates.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,20 @@ fi
107107
# Probably `limactl create` should have "dry run" mode that just generates `lima.yaml`.
108108
# shellcheck disable=SC2086
109109
"${LIMACTL_CREATE[@]}" ${LIMACTL_CREATE_ARGS} --set ".additionalDisks=null" --name="${NAME}-tmp" "$FILE_HOST"
110-
case "$(yq '.networks[].lima' "${LIMA_HOME}/${NAME}-tmp/lima.yaml")" in
111-
"shared")
112-
CHECKS["vmnet"]=1
113-
;;
114-
"user-v2")
115-
CHECKS["port-forwards"]=""
116-
CHECKS["user-v2"]=1
117-
;;
118-
esac
110+
# skipping the missing yq as it is not a fatal error because networks we are looking for are not supported on windows
111+
if command -v yq &>/dev/null; then
112+
case "$(yq '.networks[].lima' "${LIMA_HOME}/${NAME}-tmp/lima.yaml")" in
113+
"shared")
114+
CHECKS["vmnet"]=1
115+
;;
116+
"user-v2")
117+
CHECKS["port-forwards"]=""
118+
CHECKS["user-v2"]=1
119+
;;
120+
esac
121+
else
122+
WARNING "yq not found. Skipping network checks"
123+
fi
119124
limactl rm -f "${NAME}-tmp"
120125

121126
if [[ -n ${CHECKS["port-forwards"]} ]]; then

0 commit comments

Comments
 (0)