fix(get_config): strip veth interfaces — Docker container churn causes false-positive config changes every poll

Docker creates a fresh veth pair with a new random name and ifindex
for every container start/restart. ip addr show includes them, so
get_config() reported a "config change" on nearly every poll of a
Docker host even though nothing about the host's own configuration
changed.
This commit is contained in:
Christian Manivong
2026-07-01 20:32:20 +02:00
parent 06cd1dc7aa
commit d16a05e501
2 changed files with 47 additions and 1 deletions
+7 -1
View File
@@ -697,13 +697,19 @@ class LinuxDriver(OSDriver):
``valid_lft`` / ``preferred_lft`` fields from DHCP leases are stripped
so the output is stable across polls and does not produce false-positive
config-change events in the config-backup feature.
config-change events in the config-backup feature. ``veth*`` interfaces
are stripped entirely — Docker creates/destroys them with a fresh index
and random name on every container restart, which would otherwise flag
a config change on nearly every poll of a Docker host.
"""
import re
running = self._send("ip addr show && ip route show")
# Strip volatile DHCP lease timer fields — they decrement every poll
running = re.sub(r"\s+valid_lft\s+\S+\s+preferred_lft\s+\S+", "", running)
# Strip veth interface blocks (line + indented sub-lines) — ephemeral
# Docker container network endpoints, not intentional host config
running = re.sub(r"^\d+: veth\S*:.*\n(?:[ \t]+.*\n?)*", "", running, flags=re.MULTILINE)
return {"running": running, "startup": "", "candidate": ""}
# ------------------------------------------------------------------