Commit bce708c2 authored by saadali's avatar saadali

Modify Detach method to take disk name

parent b1560f36
...@@ -2006,7 +2006,8 @@ func (kl *Kubelet) cleanupOrphanedVolumes(pods []*api.Pod, runningPods []*kubeco ...@@ -2006,7 +2006,8 @@ func (kl *Kubelet) cleanupOrphanedVolumes(pods []*api.Pod, runningPods []*kubeco
glog.Errorf("Could not unmount the global mount for %q: %v", name, err) glog.Errorf("Could not unmount the global mount for %q: %v", name, err)
} }
err = detacher.Detach(refs[0], kl.hostname) pdName := path.Base(refs[0])
err = detacher.Detach(pdName, kl.hostname)
if err != nil { if err != nil {
glog.Errorf("Could not detach volume %q at %q: %v", name, volumePath, err) glog.Errorf("Could not detach volume %q at %q: %v", name, volumePath, err)
} }
......
...@@ -152,9 +152,8 @@ type Attacher interface { ...@@ -152,9 +152,8 @@ type Attacher interface {
// Detacher can detach a volume from a node. // Detacher can detach a volume from a node.
type Detacher interface { type Detacher interface {
// Detach the given device from the given host.
// Detach the given volume from the given host. Detach(deviceName, hostName string) error
Detach(deviceMountPath string, hostName string) error
// WaitForDetach blocks until the device is detached from this // WaitForDetach blocks until the device is detached from this
// node. If the device does not detach within the given timeout // node. If the device does not detach within the given timeout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment