multus-cni
multus-cni copied to clipboard
Configuration writes should be atomic
This change introduces a method atomicFileWrite(...)
which writes to a temporary file and then renames it to avoid partial reads, e.g.
Mar 29 04:13:05 labkubedualhost-node-1 crio[33593]: time="2024-03-29 04:13:05.977398607+09:00" level=info msg="CNI monitoring event CREATE \"/etc/cni/net.d/00-multus.conf\""
Mar 29 04:13:05 labkubedualhost-node-1 crio[33593]: time="2024-03-29 04:13:05.977767189+09:00" level=error msg="Error loading CNI config file /etc/cni/net.d/00-multus.conf: error parsing configuration: unexpected end of JSON input"