diff --git a/k3s-cleanup/cleanup.daemonset.yaml b/k3s-cleanup/cleanup.daemonset.yaml index efea409..88c6a08 100644 --- a/k3s-cleanup/cleanup.daemonset.yaml +++ b/k3s-cleanup/cleanup.daemonset.yaml @@ -30,13 +30,16 @@ spec: cd ${CLEANUPROOT}; while true; do echo "$(date -Iseconds) Starting k3s cleanup of ${CLEANUPROOT}"; - for subdir in $(find ${CLEANUPROOT} -mindepth 1 -maxdepth 1 -type d); do + for subdir in $(find ${CLEANUPROOT} -mindepth 1 -maxdepth 1 -type d); do if [ $(readlink ${CLEANUPROOT}/current) == ${subdir} ]; then echo ✅ Skipping ${subdir} - it is current k3s data; continue; elif [ $(readlink ${CLEANUPROOT}/previous) == ${subdir} ]; then echo ✅ Skipping ${subdir} - it is previous k3s data; continue; + elif [ $(basename ${subdir}) == "cni" ]; then + echo ✅ Skipping ${subdir}; + continue; fi; echo 🗑️ Removing ${subdir}; rm -r ${subdir};