Skip to content

Tear down networks in reverse of configured order#137

Open
jronak wants to merge 1 commit into
containerd:mainfrom
jronak:fix/remove-reverse-order
Open

Tear down networks in reverse of configured order#137
jronak wants to merge 1 commit into
containerd:mainfrom
jronak:fix/remove-reverse-order

Conversation

@jronak
Copy link
Copy Markdown

@jronak jronak commented May 5, 2026

Remove currently tears down networks in the same order they were configured. This means a config loaded as WithLoNetwork, WithDefaultConf runs loopback DEL before the user-defined network DEL.

The CNI spec tears down plugin chains in reverse order, and the same rule should apply here: networks added earlier should stay available while later networks are being removed. In practice this keeps lo up until user-defined plugins have finished their cleanup. This changes Remove to iterate c.networks in reverse order and adds a regression test for the ordering.

Signed-off-by: ronakj ronakjainc@gmail.com

libcni.Remove iterated c.networks in the same order they were
configured (FIFO). The CNI spec expects teardown to run in reverse
of setup; iterate c.networks in reverse on Remove to match.

Add a regression test covering the new ordering.

Signed-off-by: ronakj <ronakjainc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant