mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2026-07-26 18:39:58 +00:00
A clusterNetwork loaded from a .conflist path was reconstructed via the lossy cnitypes.PluginConf, dropping CNI-specific fields (calico's kubeconfig/datastore_type/policy, etc). ADD survived by using the complete CNINetworkConfigList, but DEL used the stripped Bytes, so calico could not build its datastore client, never released the IP, and leaked one address per teardown. - LoadDelegateNetConfFromConfList: rebuild Bytes losslessly from the libcni raw bytes (per-plugin, covering subdirectory-chain plugins) instead of marshaling the lossy NetConfList; assign Bytes once after deviceID/cni-args injection (fixes deviceID-without-cni-args drop) - collapse the redundant CNINetworkConfigList field; conflistAdd now uses Bytes uniformly, removing the dual source of truth and the TODO - CmdDel: inject cniVersion onto raw Bytes via InjectCNIVersionInConfList instead of re-marshaling the lossy ConfList (second stripping point) - add regression tests for field preservation, subdirectory-chain plugins, and cniVersion injection Signed-off-by: Chen Tang <tangchen1234567@gmail.com>