Skip to content

ateapi: bracket IPv6 atelet addresses when dialing - #785

Open
Yuan Gao (ygao-g) wants to merge 1 commit into
agent-substrate:mainfrom
ygao-g:ateapi-ipv6-dial-atelet
Open

ateapi: bracket IPv6 atelet addresses when dialing#785
Yuan Gao (ygao-g) wants to merge 1 commit into
agent-substrate:mainfrom
ygao-g:ateapi-ipv6-dial-atelet

Conversation

@ygao-g

Copy link
Copy Markdown
Contributor

Part of #246

ateapi built its atelet dial target by concatenating the pod IP with
":8085", which is wrong for IPv6: the target has to be
[fd00:10:244::7]:8085, not fd00:10:244::7:8085, and net.Dial rejects
the unbracketed form with "too many colons in address". grpc.NewClient
connects lazily, so this surfaced only as Unavailable on every snapshot
and restore RPC, reading as a storage bug rather than a networking one.
Use net.JoinHostPort, which brackets the host only when it is an IPv6
literal.

Also lifts the duplicated 8085 literal into internal/ateletport.Default,
shared by atelet's --port flag and ateapi's dial target; nothing enforced
agreement between the two binaries before.

This is verifiable without an IPv6 cluster — the test asserts the resolved
ClientConn.Target() over a fake pod indexer for v4, v6, and ::1, so it
does not depend on the dual-stack kind work in #246.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

🤖 Generated with Claude Code

@google-cla

google-cla Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ygao-g
Yuan Gao (ygao-g) force-pushed the ateapi-ipv6-dial-atelet branch from 09874e2 to d4737aa Compare August 6, 2026 19:45
@ygao-g

Copy link
Copy Markdown
Contributor Author

Bowei Du (@bowei) haiyanmeng PTAL

Comment thread internal/ateletport/ateletport.go Outdated
@ygao-g
Yuan Gao (ygao-g) force-pushed the ateapi-ipv6-dial-atelet branch 3 times, most recently from ac73cdd to 129f397 Compare August 10, 2026 15:27
Comment thread internal/atelet/port.go
@@ -0,0 +1,21 @@
// Copyright 2026 Google LLC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in internal/atelet

doc.go

// Package atelet contains shared constants and definitions that are used across
// Substrate components related to atelet.
package atelet

Having a package just for port is too narrow.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — moved to internal/atelet with doc.go as suggested; the constant now lives in port.go.

One adjustment: renamed DefaultDefaultPort, since atelet.Default doesn't say much once the package isn't port-specific. Call sites read atelet.DefaultPort.

The atelet dial target concatenated the pod IP with ":8085", which
net.Dial rejects for IPv6; grpc.NewClient dials lazily, so it surfaced
as Unavailable on every snapshot and restore. Use net.JoinHostPort.

Also lifts the 8085 literal into internal/atelet.DefaultPort, shared by
atelet's --port flag and the dial target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants