mirror of https://github.com/k3s-io/k3s
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: https://github.com/kubernetes/kubernetes/issues/56455pull/6/head
commit
01c3f7f85b
|
@ -590,7 +590,11 @@ func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error) {
|
|||
func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error) {
|
||||
attached := make(map[string]bool)
|
||||
for _, volumeID := range volumeIDs {
|
||||
isAttached, _ := os.DiskIsAttached(instanceID, volumeID)
|
||||
isAttached, err := os.DiskIsAttached(instanceID, volumeID)
|
||||
if err != nil && err != ErrNotFound {
|
||||
attached[volumeID] = true
|
||||
continue
|
||||
}
|
||||
attached[volumeID] = isAttached
|
||||
}
|
||||
return attached, nil
|
||||
|
|
Loading…
Reference in New Issue