mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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 {
|
if len(serverList) == 0 {
|
||||||
return nil, ErrNotFound
|
return nil, ErrNotFound
|
||||||
} else if len(serverList) > 1 {
|
|
||||||
return nil, ErrMultipleResults
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &serverList[0], nil
|
return &serverList[0], nil
|
||||||
|
Loading…
Reference in New Issue
Block a user