Merge pull request #50042 from jingxu97/Aug/cinderfix

Automatic merge from submit-queue (batch tested with PRs 50087, 39587, 50042, 50241, 49914)

AttachDisk should not call detach inside of Cinder volume provider
This commit is contained in:
Kubernetes Submit Queue 2017-08-07 10:58:59 -07:00 committed by GitHub
commit d6cb4827bf

View File

@ -230,11 +230,9 @@ func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) {
glog.V(4).Infof("Disk %s is already attached to instance %s", volumeID, instanceID)
return volume.ID, nil
}
glog.V(2).Infof("Disk %s is attached to a different instance (%s), detaching", volumeID, volume.AttachedServerId)
err = os.DetachDisk(volume.AttachedServerId, volumeID)
if err != nil {
return "", err
}
errmsg := fmt.Sprintf("Disk %s is attached to a different instance (%s)", volumeID, volume.AttachedServerId)
glog.V(2).Infof(errmsg)
return "", errors.New(errmsg)
}
startTime := time.Now()