Files
multus-cni/pkg/types
Chen Tang 6597fa65f5 fix(types): preserve conflist delegate config so DEL does not leak IPs
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>
2026-07-21 20:34:33 +08:00
..