Changes how new kubeconfig is created after CA/token change. Instead of always creating new file on disk and comparing it to existing, it will compare base files (ca.crt and token) and recreate kubeconfig only if they changed.
Multus CNI config is now treated the same way - as base file the master cni config is used.
As a result thin_entrypoint will no longer create new kubeconfig and 00-multus on each iteration of the watch loop and only recreate them when underlying base files change.
This approach was chosen over using a fsnotify because it wasn't reliable watching /var/run/secrets/kubernetes.io/serviceaccount/ - it would just stop noticing changes to files, possible reason is underlying filesystem being tmpfs.
coverage: 63.051% (-0.05%) from 63.099%
when pulling f6b8ae848526825894da695789e6349566fb9711 on pmtk:recreate-configs-on-file-change
into ca5a4c9aa97c9ac89413ae378865091e4e7e5f97 on k8snetworkplumbingwg:master.
Changes how new kubeconfig is created after CA/token change. Instead of always creating new file on disk and comparing it to existing, it will compare base files (
ca.crt
andtoken
) and recreate kubeconfig only if they changed. Multus CNI config is now treated the same way - as base file the master cni config is used.As a result
thin_entrypoint
will no longer create new kubeconfig and 00-multus on each iteration of the watch loop and only recreate them when underlying base files change.This approach was chosen over using a fsnotify because it wasn't reliable watching
/var/run/secrets/kubernetes.io/serviceaccount/
- it would just stop noticing changes to files, possible reason is underlying filesystem beingtmpfs
.Closes https://github.com/k8snetworkplumbingwg/multus-cni/issues/1220