containernetworking / plugins

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

Use temporary name for netdevice when moving in/out of NS #1002

Closed adrianchiris closed 4 months ago

adrianchiris commented 6 months ago

Today, it is not possible to use host-device CNI to move a host device to container namespace if a device with the same netdev name already exists in that namespace.

e.g when a delegate plugin (such as multus) is used to provide multiple networks to a container, CNI Add call will fail if the targeted host device name already exists in container network namespace.

to overcome this, we use a temporary name for the interface before moving it in/out of container network namespace.

adrianchiris commented 6 months ago

@squeed @dcbw could you take a look a this one :)

adrianchiris commented 4 months ago

@s1061123 thx for reviewing. comment addressed.