Open mawiegand opened 4 years ago
The auto_netns
option is a bit problematic, and has more pitfalls than one may believe.
I will look into that netns
difference and will try to equalize it, but notice also one thing. If there are no netns at the moment of the NDB start, auto_netns
may not detect appearing network namespaces as the first netns remounts the directory which is monitored.
I'll try to fix that bug, but as for now it exists.
UPD: s/will not detect/may not detect/
Another question is what to do if we start NDB with auto_netns=True
and then manually run ndb.sources.add(netns=…)
. Right now it adds two sources — the manual one and the auto.
Probably it would be better to reject manual netns source addition when auto_netns
is True
.
So, any ideas about auto_netns
are welcome. Or maybe completely remove it.
The netns
attr issue is addressed in this commit: https://github.com/svinota/pyroute2/commit/7af5e766aa3ce4c64f420c55696920e7f688e8a3
Should be better now
The
auto_netns
option for NDB is nice, but why does it handle the attributestarget
andnetns
other than it is done when adding an netns manually by usingndb.sources.add(netns='mynetns')
?If I have a netns
ns1
usingauto_netns
results inBut using
ndb.sources.add(netns='ns1')
results inIs there a reason for this behaviour? Thanks!