mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
should check the return value of os.DiskIsAttached
This commit is contained in:
parent
1e67feac75
commit
e80dcba297
@ -419,7 +419,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
Block a user