k3s/pkg/agent/flannel
Jay Kubo 68ce5c2747 fix: populate IfaceName in LookupExtInterface for VXLAN recreation
LookupExtInterface() constructs a backend.ExternalInterface but never
sets the IfaceName field, leaving it as an empty string. When the VXLAN
device (flannel.1) is deleted — e.g. because the parent interface
specified via --flannel-iface transiently disappears — the recreation
code in vxlan_network.go:165 calls net.InterfaceByName(""), which
always fails. This puts flannel into an unrecoverable retry loop:

  external interface  not found, retrying in 30s

The fix adds IfaceName: iface.Name to the struct literal. The iface
variable already holds the correct *net.Interface; its Name field just
needs to be copied into the IfaceName string that the VXLAN recreation
path reads.

This is a one-line change that enables the VXLAN device recreation
logic added in flannel PR #2272 (v0.27.4+) to actually work when
flannel is embedded in K3s.

Affects any deployment using --flannel-iface with an overlay network
(Tailscale, Nebula, ZeroTier) where the parent interface can
transiently restart.

Ref: https://github.com/k3s-io/k3s/issues/12436
Ref: https://github.com/flannel-io/flannel/issues/2247

Signed-off-by: Jay Kubo <6161465+jkubo@users.noreply.github.com>
2026-05-26 16:04:18 -07:00
..
flannel.go fix: populate IfaceName in LookupExtInterface for VXLAN recreation 2026-05-26 16:04:18 -07:00
setup.go Update packages to remove dep on archived github.com/pkg/errors 2026-03-09 16:09:01 -07:00
setup_linux.go lint: redundant-build-tag 2025-12-18 11:20:07 -08:00
setup_test.go lint: unnecessary-format,use-errors-new 2025-12-18 11:20:07 -08:00
setup_windows.go lint: redundant-build-tag 2025-12-18 11:20:07 -08:00