k8snetworkplumbingwg / multus-cni

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

Minimize temp file creations for createKubeConfig and createMultusConfig #1231

Closed connorkuehl closed 7 months ago

connorkuehl commented 7 months ago

The thin plugin invokes this function in a tight loop when using --cleanup-config-on-exit and --multus-conf-file=auto.

Instead of rendering directly to the temp file, render to an in-memory buffer which can simply be discarded if there's no need to replace the working copy of the file.

connorkuehl commented 7 months ago

Looks like a different PR to accomplish this was merged https://github.com/k8snetworkplumbingwg/multus-cni/pull/1234

Closing.