Merge pull request #61082 from wenlxie/githubupstream.master.ignorevolumeerrorstatus

Automatic merge from submit-queue (batch tested with PRs 61549, 62230, 62055, 61082, 62212). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

don't do attach and deatch when cinder volume status is error

When cinder volume status is `error`, it is not supposed to handle operation like `attach` and `detach`

@dims  @FengyunPan2

```release-note
cinder volume plugin : 
When the cinder volume status is `error`,  controller will not do `attach ` and `detach ` operation
```
pull/8/head
Kubernetes Submit Queue 2018-04-10 18:19:16 -07:00 committed by GitHub
commit 27045d3fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -310,7 +310,8 @@ func (os *OpenStack) OperationPending(diskName string) (bool, string, error) {
}
volumeStatus := volume.Status
if volumeStatus == volumeErrorStatus {
return false, volumeStatus, nil
err = fmt.Errorf("status of volume %s is %s", diskName, volumeStatus)
return false, volumeStatus, err
}
if volumeStatus == volumeAvailableStatus || volumeStatus == volumeInUseStatus || volumeStatus == volumeDeletedStatus {
return false, volume.Status, nil