mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #83379 from davidz627/revert-79784-July/RemoveDeviceVolumeDir
Revert "Bugfix: remove PV dir when umount raw block device"
This commit is contained in:
commit
246df354a5
@ -21,7 +21,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"k8s.io/klog"
|
||||
@ -362,25 +361,5 @@ func (m *csiBlockMapper) TearDownDevice(globalMapPath, devicePath string) error
|
||||
}
|
||||
}
|
||||
|
||||
dataDir := getVolumeDeviceDataDir(m.specName, m.plugin.host)
|
||||
|
||||
// remove ~/${pv}/data/vol_data.json first, then remove the other dir.
|
||||
volDataFile := path.Join(dataDir, volDataFileName)
|
||||
err = os.Remove(volDataFile)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
// remove ~/${pv}/data
|
||||
err = os.Remove(dataDir)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove ~/${pv}
|
||||
pvPath := filepath.Dir(dataDir)
|
||||
err = os.Remove(pvPath)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user