containernetworking / plugins

Some reference and example networking plugins, maintained by the CNI team.
Apache License 2.0
2.14k stars 775 forks source link

bridge: Enable disabling bridge interface #997

Closed ormergi closed 6 months ago

ormergi commented 6 months ago

The new disableContainerInterface parameter is added to the bridge plugin to enable setting the container interface state down.

When the parameter is enabled, the container interface (veth peer that is placed at the container ns) remain down (i.e: disabled). The bridge and host peer interfaces state are not affected by the parameter.

Notes for reviewers:

Related Issue: https://github.com/containernetworking/plugins/issues/951

ormergi commented 6 months ago

/cc @EdDev @AlonaKaplan

ormergi commented 6 months ago

Changes: fix linter issues

ormergi commented 6 months ago

Changes: add failing test when both IPAM and disable-interface parameters are set

ormergi commented 6 months ago

have you checked if there is something to do for the check command? Does it verify that the link is up?

Hi @mlguerrero12 thanks for the review :grinning: , from what I saw the check cmd does not check the interface state at all.

squeed commented 6 months ago

From what I saw the check cmd does not check the interface state at

Hah. Oops :-). Well, that would be good to fix, but it could be in a separate PR :grimacing:

ormergi commented 6 months ago

Hey @squeed please take another look, let me know if there is anything else we should do :slightly_smiling_face:

ormergi commented 6 months ago

Updating docs PR https://github.com/containernetworking/cni.dev/pull/137

squeed commented 6 months ago

Thanks for your contribution!