Skip to content

Commit 4b478a0

Browse files
committed
hack/verify: keep the gateway Envoy admin sockets dual-stack
Both gateway admin sockets bind "::" with ipv4_compat, and the flag is what keeps their in-pod callers working: dataplane.go health-checks the router's over IPv4 loopback, and envoydrain.go dials the egress one the same way and reads a refusal as "Envoy already exited", skipping the drain without reporting an error. No Go test, golden file, or verify script read either manifest, so dropping the flag would have failed silently. make verify now rejects an admin socket that binds "::" without it.
1 parent 2549657 commit 4b478a0

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

‎hack/verify/atenet-admin-bind.sh‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2026 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Dropping ipv4_compat from a gateway's Envoy admin socket fails silently: the
18+
# drain sequence reads the refused IPv4 loopback dial as "Envoy already exited"
19+
# and reports a drain it never performed. No Go test reads these manifests.
20+
21+
set -o errexit -o nounset -o pipefail
22+
23+
ROOT="$(git rev-parse --show-toplevel)"
24+
cd "${ROOT}"
25+
26+
rc=0
27+
for f in manifests/ate-install/atenet-router.yaml manifests/ate-install/atenet-egress.yaml; do
28+
block="$(grep -A 6 -E '^ *admin:$' "${f}" || true)"
29+
if [[ -z "${block}" ]]; then
30+
echo "${f}: no Envoy admin block found; this check needs updating" >&2
31+
rc=1
32+
elif ! grep -q '"::"' <<<"${block}"; then
33+
echo "${f}: Envoy admin socket does not bind \"::\"; an IPv6-primary pod cannot be probed" >&2
34+
rc=1
35+
elif ! grep -q 'ipv4_compat: true' <<<"${block}"; then
36+
echo "${f}: Envoy admin socket binds \"::\" without ipv4_compat; IPv4 loopback dials will be refused" >&2
37+
rc=1
38+
fi
39+
done
40+
41+
exit "${rc}"

0 commit comments

Comments
 (0)