Skip to content

Commit

Permalink
fix(k3s-cleanup): do not remove new cni dir in data
Browse files Browse the repository at this point in the history
It gets created since k3s-io/k3s#10868
  • Loading branch information
zdzichu committed Dec 13, 2024
1 parent 3740c7e commit 2924bbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion k3s-cleanup/cleanup.daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 2924bbb

Please sign in to comment.