Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Remove useless unmount code #156

Merged
merged 1 commit into from
Dec 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions pkg/volume/cinder/cinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ func (c *cinderVolumeUnmounter) TearDown() error {
// resource was the last reference to that disk on the kubelet.
func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
glog.V(5).Infof("Cinder TearDown of %s", dir)

notmnt, err := c.mounter.IsLikelyNotMountPoint(dir)
if err != nil {
glog.V(4).Infof("IsLikelyNotMountPoint check failed: %v", err)
Expand Down Expand Up @@ -481,20 +482,6 @@ func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
}
glog.V(3).Infof("Successfully unmounted: %s\n", dir)

// NOTE(harryz) use manager to detach disk,refactor this into cinder.attacher when manager is removed
// 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 !c.withOpenStackCP && c.isNoMountSupported {
if len(refs) == 1 {
if err := c.manager.DetachDisk(c); err != nil {
glog.V(4).Infof("DetachDisk failed: %v", err)
return err
}
glog.V(3).Infof("Volume %s detached", c.pdName)
}
}
// NOTE END

notmnt, mntErr := c.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr)
Expand Down