]> go.fuhry.dev Git - runtime.git/commit
[sd] always publish on non-loopback addresses
authorDan Fuhry <dan@fuhry.com>
Tue, 13 Oct 2026 13:29:50 +0000 (09:29 -0400)
committerDan Fuhry <dan@fuhry.com>
Mon, 19 Oct 2026 21:28:27 +0000 (17:28 -0400)
commitbe3a00e320509d6ad7f09fdf1f8a8790c520966a
treee9393b1a6dab1e4be7e54cec9895f654b3e0bdce
parent5f299313d15e89704a0e261c6c19c6b53f4ebf60
[sd] always publish on non-loopback addresses

When adding support for service discovery publishing as a sidecar, I realized that health probes are often performed against the loopback address, but the sd libraries don't support separate addresses for probing and publication.

This commit adds that by detecting the local primary IPv4 and IPv6 addresses when the probe address is a loopback IP.

Supporting changes:

- Add `net2` library with `MyIP4()` and `MyIP6()`

**🚫🤖 No AI**
sd/BUILD.bazel
sd/healthcheck.go
sd/healthcheck_http.go
sd/healthcheck_ldap.go
sd/monitor.go
sd/watcher.go
utils/net2/BUILD.bazel [new file with mode: 0644]
utils/net2/myip.go [new file with mode: 0644]
utils/net2/myip_generic.go [new file with mode: 0644]
utils/net2/myip_linux.go [new file with mode: 0644]