From fdc0c4f48e6839142db30c2fb9c6d5c84b9eba90 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 9 Sep 2026 19:29:06 +0000 Subject: interfaces: T9269: do not run the hw-id naming pass in a container Container interfaces are veth pairs created by the runtime. They have no backing bus device in sysfs, so discover_physical_interfaces() never considers them, and their MAC is assigned by the host and regenerated on every start. A pending node could thus never be resolved. The pass only spent both bounded hardware waits and then asked for an hw-id that would not survive a restart: interface 'eth0' still has no hw-id configured after this boot's naming pass - bind it manually, e.g. ... Returning before write_status() leaves no status file behind, so warn_missing_interface_hardware() in vyos-router stays quiet by itself. setUpModule() pins the detection off for the test module - the build container would otherwise short-circuit every existing main() test. --- src/system/vyos-net-name-resolve.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/system') diff --git a/src/system/vyos-net-name-resolve.py b/src/system/vyos-net-name-resolve.py index 5b1f36533..e28f3b3c4 100755 --- a/src/system/vyos-net-name-resolve.py +++ b/src/system/vyos-net-name-resolve.py @@ -41,6 +41,7 @@ from sys import exit from vyos.configtree import ConfigTree from vyos.defaults import directories from vyos.migrate import ConfigMigrate +from vyos.system.image import is_running_as_container from vyos.utils.process import rc_cmd from vyos.utils.process import run @@ -613,6 +614,14 @@ def write_status(configured: dict, found: dict, missing: set, plan: dict, def main(): + if is_running_as_container(): + # A container has no NIC of its own - its interfaces are veth pairs + # created by the container runtime. They have no backing bus device in + # sysfs and their MAC is assigned by the host and regenerated on every + # start, so there is nothing to wait for and no hw-id worth binding. + logger.info('running inside a container - skipping hw-id naming pass') + return + configured = get_configfile_interfaces() pending = get_pending_hwid_nodes() -- cgit v1.2.3