Skip to content

Commit 2e2d084

Browse files
committed
kubeadm: reset don't unmount /var/lib/kubelet if it is mounted
Previous PR that fixes this kubernetes#71663 Signed-off-by: Thomas Tanaka <[email protected]>
1 parent 56c7602 commit 2e2d084

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/kubeadm/app/cmd/phases/reset/unmount_linux.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ func unmountKubeletDirectory(absoluteKubeletRunDirectory string) error {
3232
if err != nil {
3333
return err
3434
}
35+
36+
if !strings.HasSuffix(absoluteKubeletRunDirectory, "/") {
37+
// trailing "/" is needed to ensure that possibly mounted /var/lib/kubelet is skipped
38+
absoluteKubeletRunDirectory += "/"
39+
}
40+
3541
mounts := strings.Split(string(raw), "\n")
3642
for _, mount := range mounts {
3743
m := strings.Split(mount, " ")

0 commit comments

Comments
 (0)