mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Reverse the order of unmounting and removing the pd disk.
This should mean that we retry detaching if the original detach fails for some reason.
This commit is contained in:
parent
0345211e0c
commit
a0b8429d2e
@ -234,9 +234,6 @@ func (pd *gcePersistentDisk) TearDown() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
refCount--
|
refCount--
|
||||||
if err := os.RemoveAll(pd.GetPath()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// If refCount is 1, then all bind mounts have been removed, and the
|
// If refCount is 1, then all bind mounts have been removed, and the
|
||||||
// remaining reference is the global mount. It is safe to detach.
|
// remaining reference is the global mount. It is safe to detach.
|
||||||
if refCount == 1 {
|
if refCount == 1 {
|
||||||
@ -244,5 +241,8 @@ func (pd *gcePersistentDisk) TearDown() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if err := os.RemoveAll(pd.GetPath()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user