Repository navigation
bridge: skip the IPAM CHECK when no IPAM plugin is configured - #1318
Merged
mlguerrero12 merged 1 commit intoNov 9, 2026
Merged
mlguerrero12 merged 1 commit into
mlguerrero12 merged 1 commit into
Conversation
A bridge config without an ipam type is an L2-only network. ADD, DEL and STATUS already skip IPAM for it, but CHECK always called the IPAM plugin with an empty name and failed with "no plugin name provided" for a healthy L2-only bridge. Only call the IPAM plugin in CHECK when an ipam type is set, as macvlan, ipvlan, tap and host-device do. The remaining prevResult checks still run. Add an ADD/DEL/CHECK spec for an L2-only bridge and let cmdAddDelCheckTest skip the host-local config load for it. Signed-off-by: spicysharkco <321699413+spicysharkco@users.noreply.github.com>
mlguerrero12
force-pushed
the
fix/bridge-check-without-ipam
branch
from
November 9, 2026 14:53
897b7f2 to
151c2d1
Compare
mlguerrero12
approved these changes
Nov 9, 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.
A bridge network without an
ipamtype is L2-only. ADD, DEL and STATUSalready skip IPAM for it (
n.IPAM.Type != ""), but CHECK does not.Config: a bridge config with
"ipam": {}, the L2-only form documented athttps://www.cni.dev/plugins/current/main/bridge/ and used by the existing
L2 specs, cniVersion 0.4.0 or later, and the
prevResultreturned by asuccessful ADD.
Input:
CNI_COMMAND=CHECKwith that config.Base output:
no plugin name provided. The same failure comes from everycniVersion that has CHECK (0.4.0, 1.0.0 and 1.1.0 in the specs; the 0.3.x
testers do not run CHECK).
Expected: CHECK validates the bridge, the veth pair and the container
interface from
prevResult, as it does with IPAM, and returns no error.Cause:
ipam.ExecCheck(n.IPAM.Type, ...)runs unconditionally with anempty type:
plugins/plugins/main/bridge/bridge.go
Lines 1019 to 1023 in 5ed4cbb
Fix: call it only when
n.IPAM.Typeis set, as macvlan, ipvlan, tap andhost-device do in their CHECK.
Visible change: CHECK on an L2-only bridge returns success (or the
normal prevResult validation errors) instead of
no plugin name provided. Configs with an ipam type behave as before.Test: a new ADD/DEL/CHECK spec for an L2-only bridge.
cmdAddDelCheckTestno longer loads the host-local config for an L2 case, since an L2 config
has no ranges. The spec fails at base for 0.4.0, 1.0.0 and 1.1.0 with
no plugin name provided(the 0.3.x tester does not run CHECK, so thosetwo pass either way), and passes at head.
Base: 2 passed, 3 failed. Head: 5 passed. Whole package at head:
343 passed, 0 failed.