Documentation
¶
Overview ¶
Package hostinfo derives runtime host information used by laptop-mode CLI defaulting (e.g. host IP → nip.io fallback for ingress.domain).
Kept separate from the translator so the translator stays deterministic and unit-testable: anything host-derived flows in via call sites that explicitly fetch it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectHostIP ¶
DetectHostIP returns the IPv4 address that would be used as the source when reaching the outside world. The UDP "fake dial" trick: opening a UDP socket toward a routable address makes the OS populate the local address with the route's source IP, without sending any packet.
This deliberately does NOT use net.InterfaceAddrs(): on a typical laptop that returns five-plus addresses (loopback, multiple interfaces, IPv6 link-locals) and we'd guess at which one is reachable from a workshop container running in kind.
func NipDomain ¶
NipDomain converts a dotted-quad IPv4 (e.g. 192.168.1.10) into the nip.io wildcard subdomain shape (192-168-1-10.nip.io). nip.io serves both `1-2-3-4.nip.io` and `1.2.3.4.nip.io`; the dash form survives Kubernetes' DNS label length / character restrictions when subdomains are prepended (e.g. workshop names).
Types ¶
This section is empty.