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

Commit a7f02c6

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #56546 from wenlxie/githubupstream.master.fixdiskareattachedbug
Automatic merge from submit-queue (batch tested with PRs 56337, 56546, 56550, 56633, 56635). 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>. should check the return value of os.DiskIsAttached This fix is for issue: kubernetes/kubernetes#56455
2 parents f2ef4c3 + c97c691 commit a7f02c6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/cloudprovider/providers/openstack/openstack_volumes.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,11 @@ func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error) {
590590
func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error) {
591591
attached := make(map[string]bool)
592592
for _, volumeID := range volumeIDs {
593-
isAttached, _ := os.DiskIsAttached(instanceID, volumeID)
593+
isAttached, err := os.DiskIsAttached(instanceID, volumeID)
594+
if err != nil && err != ErrNotFound {
595+
attached[volumeID] = true
596+
continue
597+
}
594598
attached[volumeID] = isAttached
595599
}
596600
return attached, nil

0 commit comments

Comments
 (0)