5 Commits

Author SHA1 Message Date
Rob Murray
362d4d9538 testutil:SetupTestOSContext - don't leak namespaces, netlink handles
SetupTestOSContextEx calls 'ns.Init' (which, outside tests, is protected
by a sync.Once), and it's called again by the returned OSContext.Cleanup
method. That overwrites the ns package's namespace and netlink handles
(initNs and initNl) without closing them.

Because SetupTestOSContextEx changes that shared state, it should not
be used in parallel tests. So, rather than trying to close the handles
in ns.Init if already open - un-export Init so it's always called via
its sync.Once, and add a reset function for tests to use. Have
SetupTestOSContextEx claim a mutex to avoid crashy surprises or
hard to catch issues where the ns package isn't using the expected
namespace if it is used in parallel tests.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-09-23 16:16:00 +01:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Derek McGowan
713d7f5ed1 Move internal/nlwrap to daemon/libnetwork/nlwrap
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:13:58 -07:00
Derek McGowan
3b5f7c2a29 Move internal/modprobe to daemon/libnetwork/internal/modprobe
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-14 09:25:55 -07:00
Derek McGowan
7a720df61f Move libnetwork to daemon/libnetwork
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-14 09:25:23 -07:00