Repository navigation
ns: remove obsolete conntrack module loading, simplify, and remove logging - #49
Merged
Merged
Conversation
The modprobe logic was inherited from libnetwork, where it was added for conntrack support in [moby/libnetwork@ac1e2ea]. IPVS does not use this functionality, and loading kernel modules is not necessary for detecting supported netlink families. Remove the module loading and retain socket-based capability detection for NETLINK_XFRM and NETLINK_NETFILTER. Also remove the associated warnings for unavailable optional features. [moby/libnetwork@ac1e2ea]: moby/libnetwork@ac1e2ea Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replace the manually managed sync.Once and global handles with sync.OnceValue to ensure initialization only happens once, including when Init is called directly. Preserve initialization errors internally so SetNamespace can return them, while keeping the existing exported API unchanged. Avoid using partially initialized handles, clean up on failure, and remove the logrus dependency from the package. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
FWIW; planning to deprecate this package as a whole; I couldn't find any importers beyond this module itself, and that was only as part of tests; removing that in the other PR; |
1 task done
vvoland
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

ns: remove obsolete conntrack module loading
The modprobe logic was inherited from libnetwork, where it was added
for conntrack support in moby/libnetwork@ac1e2ea.
IPVS does not use this functionality, and loading kernel modules is
not necessary for detecting supported netlink families.
Remove the module loading and retain socket-based capability detection
for NETLINK_XFRM and NETLINK_NETFILTER. Also remove the associated
warnings for unavailable optional features.
ns: simplify initialization and remove logging
Replace the manually managed sync.Once and global handles with
sync.OnceValue to ensure initialization only happens once, including
when Init is called directly.
Preserve initialization errors internally so SetNamespace can return
them, while keeping the existing exported API unchanged.
Avoid using partially initialized handles, clean up on failure, and
remove the logrus dependency from the package.