-
Notifications
You must be signed in to change notification settings - Fork 246
atenet: bind the Envoy sockets and Services dual-stack #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yuan Gao (ygao-g)
wants to merge
2
commits into
agent-substrate:main
Choose a base branch
from
ygao-g:atenet-envoy-dualstack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Dropping ipv4_compat from a gateway's Envoy admin socket fails silently: the | ||
| # drain sequence reads the refused IPv4 loopback dial as "Envoy already exited" | ||
| # and reports a drain it never performed. No Go test reads these manifests. | ||
|
|
||
| set -o errexit -o nounset -o pipefail | ||
|
|
||
| ROOT="$(git rev-parse --show-toplevel)" | ||
| cd "${ROOT}" | ||
|
|
||
| # Each admin block is bounded by the first line that dedents back to its own | ||
| # key, and is judged on its own. A fixed context window silently truncates as | ||
| # the block grows, and a whole-file match lets one compliant block satisfy the | ||
| # check on behalf of another that has regressed. Comments are stripped so that | ||
| # prose about ipv4_compat cannot stand in for the setting. | ||
| read -r -d '' AWK_ADMIN_BIND <<'EOF' || true | ||
| function flush() { | ||
| if (!open) { | ||
| return | ||
| } | ||
| open = 0 | ||
| if (block !~ /"::"/) { | ||
| printf "%s:%d: Envoy admin socket does not bind \"::\"; an IPv6-primary pod cannot be probed\n", FILENAME, start | ||
| } else if (block !~ /ipv4_compat: true/) { | ||
| printf "%s:%d: Envoy admin socket binds \"::\" without ipv4_compat; IPv4 loopback dials will be refused\n", FILENAME, start | ||
| } | ||
| } | ||
| match($0, /[^ ]/) && substr($0, RSTART) ~ /^admin:[[:space:]]*$/ { | ||
| flush() | ||
| open = 1 | ||
| indent = RSTART - 1 | ||
| start = FNR | ||
| block = "" | ||
| next | ||
| } | ||
| open { | ||
| if ($0 ~ /^[[:space:]]*$/) { | ||
| next | ||
| } | ||
| if (match($0, /[^ ]/) - 1 <= indent) { | ||
| flush() | ||
| next | ||
| } | ||
| line = $0 | ||
| sub(/^[[:space:]]*#.*/, "", line) | ||
| sub(/[[:space:]]#.*/, "", line) | ||
| block = block line "\n" | ||
| } | ||
| END { | ||
| flush() | ||
| if (!start) { | ||
| printf "%s: no Envoy admin block found; this check needs updating\n", FILENAME | ||
| } | ||
| } | ||
| EOF | ||
|
|
||
| rc=0 | ||
| for f in manifests/ate-install/atenet-router.yaml manifests/ate-install/atenet-egress.yaml; do | ||
| if [[ ! -f "${f}" ]]; then | ||
| echo "${f}: not found; this check needs updating" >&2 | ||
| rc=1 | ||
| continue | ||
| fi | ||
| problems="$(awk "${AWK_ADMIN_BIND}" "${f}")" | ||
| if [[ -n "${problems}" ]]; then | ||
| echo "${problems}" >&2 | ||
| rc=1 | ||
| fi | ||
| done | ||
|
|
||
| exit "${rc}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to sync up the configuration in the YAML with the configuration here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the comment here might have confused me. This is talking about two different sockets? If it is, can you remove the comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, two different sockets. This is the router's ingress data-plane listener; the
ipv4_compat: trueyou saw in the YAML is the Envoy admin socket on 9901. I've cut the comment down to the one line explaining whyIpv4Compatis false here — the cross-reference to the admin socket was the confusing part and it's gone.On the original question: the admin sockets can't take this shape anyway, since
bootstrap.v3.Adminhas a singleaddressfield and noadditional_addresses— one::socket withipv4_compatis the only way to serve both families there. The egress:443listener is a real Listener, so that one could match the ingress shape if you'd rather have a single idiom across listeners. Happy to do it; it's a few lines plus the test that asserts the current shape.