mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
optimize duplicate openstack serverList judgement
if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to do the judgement again
This commit is contained in:
parent
1df1ad9d34
commit
70ab5fc6b8
@ -295,8 +295,6 @@ func getServerByName(client *gophercloud.ServiceClient, name types.NodeName) (*s
|
||||
|
||||
if len(serverList) == 0 {
|
||||
return nil, ErrNotFound
|
||||
} else if len(serverList) > 1 {
|
||||
return nil, ErrMultipleResults
|
||||
}
|
||||
|
||||
return &serverList[0], nil
|
||||
|
Loading…
Reference in New Issue
Block a user