k8snetworkplumbingwg / multus-cni

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

Fix CNI cache update function to prevent nil access #1274

Closed s1061123 closed 2 months ago

s1061123 commented 2 months ago

deleteDefaultGWResult() may create 'routes:null' in CNI cache file and it causes nil pointer access at addDefaultGWCacheBytes(). This code change prevents deleteDefaultGWResult() to generate 'routes:null' in cache file.

coveralls commented 2 months ago

Coverage Status

coverage: 62.92% (+0.03%) from 62.889% when pulling 5fe124932a3d6893dfcfd5a35f9a0fa15969bb43 on s1061123:fix/gateway-nil into 4457289d1d2071cc273c135c0085bbe290cb7b9e on k8snetworkplumbingwg:master.

dougbtv commented 2 months ago

results in the error:

wrong routes format