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

Commit ba4e874

Browse files
author
Kubernetes Submit Queue
authored
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
2 parents d77f6e6 + d82186f commit ba4e874

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack_volumes.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,9 @@ func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) {
230230
glog.V(4).Infof("Disk %s is already attached to instance %s", volumeID, instanceID)
231231
return volume.ID, nil
232232
}
233-
glog.V(2).Infof("Disk %s is attached to a different instance (%s), detaching", volumeID, volume.AttachedServerId)
234-
err = os.DetachDisk(volume.AttachedServerId, volumeID)
235-
if err != nil {
236-
return "", err
237-
}
233+
errmsg := fmt.Sprintf("Disk %s is attached to a different instance (%s)", volumeID, volume.AttachedServerId)
234+
glog.V(2).Infof(errmsg)
235+
return "", errors.New(errmsg)
238236
}
239237

240238
startTime := time.Now()

0 commit comments

Comments
 (0)