diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-09 19:29:06 +0000 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-09-09 19:29:06 +0000 |
| commit | fdc0c4f48e6839142db30c2fb9c6d5c84b9eba90 (patch) | |
| tree | 6cfd430a511fb3f680956fde6973aaf29059202b /src/system | |
| parent | abf7613f8d34d7ed7bc59e7883d584625a4dd65c (diff) | |
| download | vyos-1x-fdc0c4f48e6839142db30c2fb9c6d5c84b9eba90.tar.gz vyos-1x-fdc0c4f48e6839142db30c2fb9c6d5c84b9eba90.zip | |
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.
Diffstat (limited to 'src/system')
| -rwxr-xr-x | src/system/vyos-net-name-resolve.py | 9 |
1 files changed, 9 insertions, 0 deletions
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() |
