Files
flock/pkg/agent/netns_stub.go
T
Donavan Fritz 89a3502446
Build flock Image / build (push) Has been cancelled
M6: anycast — pod lo + Ready-gated /128/32 + BIRD export
CNI ADD now adds anycast IPs to the pod's lo interface (NOT eth0 — design
doc rationale: avoid NDP/ARP DAD conflicts when N replicas share an IP).
Allocation persists the anycast list.

AnycastReconciler:
  desired = { ip → flock<8hex> } from
            committed allocations × pod.Status.PodReady=True
  diff against advertised, install/remove host /128 (v6) or /32 (v4)
  re-render bird.conf with the active set

Triggers: 2s tick, AfterCommit (per ADD/DEL), Pod informer Ready
transitions (PodCache.OnReadyChange callback).

The bird template already supported Anycast6/Anycast4 via the export
filter — this turn finally drives those slices from runtime.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-25 07:36:47 -05:00

32 lines
782 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
}
// 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")
}