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

Commit 92275ad

Browse files
authored
Merge pull request #156 from resouer/hyperhq-fix-vol
Remove useless unmount code
2 parents 02ff4a3 + 45a5a35 commit 92275ad

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

pkg/volume/cinder/cinder.go

+1-14
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ func (c *cinderVolumeUnmounter) TearDown() error {
418418
// resource was the last reference to that disk on the kubelet.
419419
func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
420420
glog.V(5).Infof("Cinder TearDown of %s", dir)
421+
421422
notmnt, err := c.mounter.IsLikelyNotMountPoint(dir)
422423
if err != nil {
423424
glog.V(4).Infof("IsLikelyNotMountPoint check failed: %v", err)
@@ -481,20 +482,6 @@ func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
481482
}
482483
glog.V(3).Infof("Successfully unmounted: %s\n", dir)
483484

484-
// NOTE(harryz) use manager to detach disk,refactor this into cinder.attacher when manager is removed
485-
// If refCount is 1, then all bind mounts have been removed, and the
486-
// remaining reference is the global mount. It is safe to detach.
487-
if !c.withOpenStackCP && c.isNoMountSupported {
488-
if len(refs) == 1 {
489-
if err := c.manager.DetachDisk(c); err != nil {
490-
glog.V(4).Infof("DetachDisk failed: %v", err)
491-
return err
492-
}
493-
glog.V(3).Infof("Volume %s detached", c.pdName)
494-
}
495-
}
496-
// NOTE END
497-
498485
notmnt, mntErr := c.mounter.IsLikelyNotMountPoint(dir)
499486
if mntErr != nil {
500487
glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr)

0 commit comments

Comments
 (0)