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:
Kubernetes Prow Robot 2019-10-01 18:41:23 -07:00 committed by GitHub
commit 246df354a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}