mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Merge pull request #3964 from brendandburns/fixer
Reverse the order of detaching and removing the pd disk.
This commit is contained in:
commit
08ce8e80ad
@ -234,9 +234,6 @@ func (pd *gcePersistentDisk) TearDown() error {
|
||||
return err
|
||||
}
|
||||
refCount--
|
||||
if err := os.RemoveAll(pd.GetPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
// If refCount is 1, then all bind mounts have been removed, and the
|
||||
// remaining reference is the global mount. It is safe to detach.
|
||||
if refCount == 1 {
|
||||
@ -244,5 +241,8 @@ func (pd *gcePersistentDisk) TearDown() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := os.RemoveAll(pd.GetPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user