Documentation
¶
Overview ¶
Package bridges enumerates Docker bridge networks so the agent's embedded DNS server can bind on each bridge gateway IP. Containers on user-defined networks reach `<service>.<namespace>.rune` through their own gateway, so the agent must serve DNS on every bridge the host has, not just the default 172.17.0.1.
The implementation is a small, dependency-light helper around the Docker SDK's NetworkList / NetworkInspect. Errors from the Docker daemon are surfaced to the caller so they can decide whether to log-and-continue or hard-fail (the agent typically does the former because the loopback bind on 127.0.0.123 is sufficient for the no-Docker dev path).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gateway ¶
Gateway pairs a Docker network's name with one of its bridge gateway IPs.
func EnumerateGateways ¶
EnumerateGateways returns the IPv4 gateway address of every Docker network with driver "bridge". The default `bridge` network is included alongside any user-defined networks (e.g. those created by docker-compose).
type Lister ¶
type Lister interface {
NetworkList(ctx context.Context, options network.ListOptions) ([]network.Inspect, error)
NetworkInspect(ctx context.Context, networkID string, options network.InspectOptions) (network.Inspect, error)
}
Lister is satisfied by *client.Client; defined as an interface so callers can inject a fake in tests.