fix(network): skip sysctl/modprobe on non-Linux in NoopNetworkPlugin - #564
Open
AruneshDwivedi wants to merge 2 commits into
Open
fix(network): skip sysctl/modprobe on non-Linux in NoopNetworkPlugin#564AruneshDwivedi wants to merge 2 commits into
AruneshDwivedi wants to merge 2 commits into
Conversation
NoopNetworkPlugin.Init runs modprobe br-netfilter and sets bridge sysctls unconditionally, which fails on Windows hosts using --network-plugin no-op. These Linux-specific operations are only needed when containers connect to Linux bridges, so skip them entirely on non-Linux platforms. Fixes Mirantis#531 Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
AruneshDwivedi
requested review from
athongsamai,
awmirantis and
smerkviladze
as code owners
June 26, 2026 08:13
There was a problem hiding this comment.
Pull request overview
This PR updates the built-in NoopNetworkPlugin initialization to avoid running Linux-specific modprobe and bridge sysctl configuration when cri-dockerd is executed on non-Linux hosts (notably Windows) with --network-plugin no-op, addressing issue #531.
Changes:
- Add a runtime OS check in
NoopNetworkPlugin.Initto return early on non-Linux platforms. - Prevents non-fatal but noisy errors from attempting to access Linux
/proc/sys/...paths on Windows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+221
to
+223
| if runtime.GOOS != "linux" { | ||
| return nil | ||
| } |
Verifies that Init returns immediately on non-Linux platforms without touching the sysctl interface. If the Linux-only path were reached, it would panic because Sysctl is nil.
Author
|
Added a build-tagged test (plugins_nonlinux_test.go, //go:build windows) that verifies Init returns immediately without touching Sysctl. If the Linux path were reached it would panic since Sysctl is nil. |
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.
NoopNetworkPlugin.Init runs modprobe br-netfilter and sets bridge sysctls unconditionally, which fails on Windows hosts using --network-plugin no-op. Skip them on non-Linux. Fixes #531