the gateway is read from the kernel table, because this job image has no ip command
ci / lint the workflow and the shell (push) Successful in 11s
ci / build, test, smoke (push) Failing after 1m27s
ci / the operator page in a real browser (push) Failing after 2m37s
ci / build the image and smoke it (push) Failing after 3m59s

Run 2355, image job: `ip: command not found`, exit 127 — the step that names the
address died one line in, before the gate ever ran. /proc/net/route carries the
same default route; its gateway is hex little-endian, and bash turns it back into
a dotted quad with no helper at all (0100110A → 10.17.0.1).
This commit is contained in:
Pavlo Ratushnyi
2026-10-05 21:26:23 +02:00
parent fb491a4041
commit 223b8d6100
+12 -4
View File
@@ -235,8 +235,12 @@ jobs:
- name: Name the address the job can reach the published ports on
run: |
set -eu
GW=$(ip route | awk '/default/ {print $3; exit}')
[ -n "$GW" ] || { echo "no default route out of the job container"; exit 1; }
# `ip` is not in this image (measured: `ip: command not found`, exit 127),
# so the route is read from the kernel's own table. The gateway there is
# hex, little-endian, and bash turns it back into dotted quad.
GWHEX=$(awk '$2=="00000000" {print $3; exit}' /proc/net/route)
[ -n "$GWHEX" ] || { echo "no default route in /proc/net/route"; exit 1; }
GW=$(printf '%d.%d.%d.%d' "0x${GWHEX:6:2}" "0x${GWHEX:4:2}" "0x${GWHEX:2:2}" "0x${GWHEX:0:2}")
echo "OPENWAF_EDGE_HOST=$GW" >> "$GITHUB_ENV"
echo "the gate will ask the edge at $GW"
@@ -363,8 +367,12 @@ jobs:
- name: Name the address the job can reach the published ports on
run: |
set -eu
GW=$(ip route | awk '/default/ {print $3; exit}')
[ -n "$GW" ] || { echo "no default route out of the job container"; exit 1; }
# `ip` is not in this image (measured: `ip: command not found`, exit 127),
# so the route is read from the kernel's own table. The gateway there is
# hex, little-endian, and bash turns it back into dotted quad.
GWHEX=$(awk '$2=="00000000" {print $3; exit}' /proc/net/route)
[ -n "$GWHEX" ] || { echo "no default route in /proc/net/route"; exit 1; }
GW=$(printf '%d.%d.%d.%d' "0x${GWHEX:6:2}" "0x${GWHEX:4:2}" "0x${GWHEX:2:2}" "0x${GWHEX:0:2}")
echo "OPENWAF_EDGE_HOST=$GW" >> "$GITHUB_ENV"
echo "the gate will ask the edge at $GW"