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/56455
This commit is contained in:
		@@ -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) {
 | 
					func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error) {
 | 
				
			||||||
	attached := make(map[string]bool)
 | 
						attached := make(map[string]bool)
 | 
				
			||||||
	for _, volumeID := range volumeIDs {
 | 
						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
 | 
							attached[volumeID] = isAttached
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return attached, nil
 | 
						return attached, nil
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user