Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit f5d1b36

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #51274 from yastij/clean-cinder-detachLogError
Automatic merge from submit-queue (batch tested with PRs 51235, 50819, 51274, 50972, 50504) Clean cinder detachlogerror **What this PR does / why we need it**: **Which issue this PR fixes** : fixes #50441 **Special notes for your reviewer**: **Release note**: ```release-note ```
2 parents bc68861 + e4bf585 commit f5d1b36

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

pkg/volume/cinder/cinder.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,6 @@ type cinderVolume struct {
275275
volume.MetricsNil
276276
}
277277

278-
func detachDiskLogError(cd *cinderVolume) {
279-
err := cd.manager.DetachDisk(&cinderVolumeUnmounter{cd})
280-
if err != nil {
281-
glog.Warningf("Failed to detach disk: %v (%v)", cd, err)
282-
}
283-
}
284-
285278
func (b *cinderVolumeMounter) GetAttributes() volume.Attributes {
286279
return volume.Attributes{
287280
ReadOnly: b.readOnly,
@@ -308,7 +301,6 @@ func (b *cinderVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
308301
b.plugin.volumeLocks.LockKey(b.pdName)
309302
defer b.plugin.volumeLocks.UnlockKey(b.pdName)
310303

311-
// TODO: handle failed mounts here.
312304
notmnt, err := b.mounter.IsLikelyNotMountPoint(dir)
313305
if err != nil && !os.IsNotExist(err) {
314306
glog.Errorf("Cannot validate mount point: %s %v", dir, err)
@@ -326,9 +318,7 @@ func (b *cinderVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
326318
}
327319

328320
if err := os.MkdirAll(dir, 0750); err != nil {
329-
// TODO: we should really eject the attach/detach out into its own control loop.
330321
glog.V(4).Infof("Could not create directory %s: %v", dir, err)
331-
detachDiskLogError(b.cinderVolume)
332322
return err
333323
}
334324

@@ -359,8 +349,6 @@ func (b *cinderVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
359349
}
360350
}
361351
os.Remove(dir)
362-
// TODO: we should really eject the attach/detach out into its own control loop.
363-
detachDiskLogError(b.cinderVolume)
364352
glog.Errorf("Failed to mount %s: %v", dir, err)
365353
return err
366354
}

0 commit comments

Comments
 (0)