Skip to content

Commit 27df218

Browse files
authored
Merge pull request kubernetes#93702 from thtanaka/feature/fix-kubeadm-reset
kubeadm: reset don't unmount /var/lib/kubelet if it is mounted
2 parents 0d2205f + 2e2d084 commit 27df218

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)