k8snetworkplumbingwg / multus-cni

A CNI meta-plugin for multi-homed pods in Kubernetes
Apache License 2.0
2.32k stars 582 forks source link

Updates to use CreateNetworkStauses from net-attach-def client, bump to v1.7.1 #1314

Closed dougbtv closed 1 month ago

dougbtv commented 1 month ago

NOTE: This functionality is dependent on https://github.com/k8snetworkplumbingwg/network-attachment-definition-client/pull/68 and will require a library update in this PR in order to be complete.

This functionality properly represents Network Status for CNI ADD results that return multiple interfaces themselves.

This approach uses a new method from the net-attach-def-client -- CreateNetworkStatuses, and refactors to account for the array return.

With the previous method, it's somewhat buggy. If multiple pod interfaces are present, it returns the last one -- and groups all of the IP addresses to that address.

For replication of the error yourself, and to see the fix in action, see this gist: https://gist.github.com/dougbtv/1eb8ac2d61d494b56d65a6b236a86e61

For the related suggested update to the NPWG net-attach-def specification, see this proposal @ https://docs.google.com/document/d/1DUTV-o6E6zlRTKZkxeDhAeyGrmq03qPgPbU580Rm7-g/edit

maiqueb commented 1 month ago

/cc

coveralls commented 1 month ago

Coverage Status

coverage: 63.857% (+0.7%) from 63.116% when pulling a28d1e469363f373969bfa61e0dc0d9c32186179 on dougbtv:client-lib-multiple-if-cni-result into 85877341745ea2184456079a73ad771c27e2dc28 on k8snetworkplumbingwg:master.