kubeadm: reset don't unmount /var/lib/kubelet if it is mounted

Previous PR that fixes this
https://github.com/kubernetes/kubernetes/pull/71663

Signed-off-by: Thomas Tanaka <thomas.tanaka@gmail.com>
This commit is contained in:
Thomas Tanaka 2020-08-04 18:45:53 -07:00
parent 56c76023f7
commit 2e2d0845cd

View File

@ -32,6 +32,12 @@ func unmountKubeletDirectory(absoluteKubeletRunDirectory string) error {
if err != nil {
return err
}
if !strings.HasSuffix(absoluteKubeletRunDirectory, "/") {
// trailing "/" is needed to ensure that possibly mounted /var/lib/kubelet is skipped
absoluteKubeletRunDirectory += "/"
}
mounts := strings.Split(string(raw), "\n")
for _, mount := range mounts {
m := strings.Split(mount, " ")