Files
Donavan Fritz 2daa2a21f3
Build flock Image / build (push) Successful in 3m23s
agent: add flock.fritzlab.net/addresses annotation (eth0 static IPs)
Like anycast, addresses IPs are advertised via BGP (/128+/32) and get
host routes via the AnycastReconciler. The sole difference: they are
assigned to pod eth0 instead of lo, so workloads that inspect their
primary interface (e.g. Plex remote-access detection) see the public IP
directly.

- annotations.go: annAddresses const, Addresses []net.IP in ParsedAnnotations
- state.go: Addresses []string persisted in allocations.json
- anycast.go: resolveAnycastTargets processes Anycast+Addresses together
- netns_linux.go: configurePodSide assigns Addresses to eth0
- netns_stub.go: mirror Addresses field for non-Linux builds
- handlers.go: thread Addresses through ADD path

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 17:50:49 -05:00

33 lines
804 B
Go

//go:build !linux
package agent
import (
"fmt"
"net"
)
// SetupRequest mirrors the Linux build's type so non-Linux callers compile.
type SetupRequest struct {
ContainerID string
Netns string
IfName string
HostIface string
IP6 net.IP
IP4 net.IP
Anycast []net.IP
Addresses []net.IP
}
// Setup is unimplemented on non-Linux platforms; the agent only runs in
// Kubernetes pods on Linux nodes. This stub lets the package build for
// developer machines (macOS) so unit tests can run.
func Setup(_ SetupRequest) error {
return fmt.Errorf("netns Setup not implemented on this platform")
}
// Teardown is unimplemented on non-Linux platforms.
func Teardown(_ string, _, _ net.IP) error {
return fmt.Errorf("netns Teardown not implemented on this platform")
}