Update cleanup.sh developer script

Modifies the script that cleans up the local environment between runs to
allow the removal of /var/lib/kubelet/pods. The previous script hung up
on volume-subpaths (in addition to io~secret and empty-dir, which were
explicitly handled). This just unmounts everything before the files are
removed in remove_files.

Change-Id: I52cbe7d0f493336c1362ca3d3988038a1a15bcef
This commit is contained in:
Phil Sphicas 2021-01-15 20:10:13 +00:00
parent c9862e5749
commit 030739114f
1 changed files with 1 additions and 6 deletions

View File

@ -86,12 +86,7 @@ stop_kubelet() {
# Issue with orhan PODS
# https://github.com/kubernetes/kubernetes/issues/38498
find /var/lib/kubelet/pods 2> /dev/null | while read orphan_pod; do
if [[ ${orphan_pod} == *io~secret/* ]] || [[ ${orphan_pod} == *empty-dir/* ]]; then
umount "${orphan_pod}" || true
rm -rf "${orphan_pod}"
fi
done
find /var/lib/kubelet/pods -exec umount {} \; 2> /dev/null
}