mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #50826 from huzhengchuan/fix/delete-deadcode
Automatic merge from submit-queue remove unused function in openstack cloud provider **What this PR does / why we need it**: List function not used in openstack cloud provider, and useless, I think need remove it. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ``` NONE ```
This commit is contained in:
commit
9aa04c755f
@ -24,7 +24,6 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"github.com/gophercloud/gophercloud"
|
||||
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
|
||||
"github.com/gophercloud/gophercloud/pagination"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
@ -49,36 +48,6 @@ func (os *OpenStack) Instances() (cloudprovider.Instances, bool) {
|
||||
return &Instances{compute}, true
|
||||
}
|
||||
|
||||
func (i *Instances) List(name_filter string) ([]types.NodeName, error) {
|
||||
glog.V(4).Infof("openstack List(%v) called", name_filter)
|
||||
|
||||
opts := servers.ListOpts{
|
||||
Name: name_filter,
|
||||
Status: "ACTIVE",
|
||||
}
|
||||
pager := servers.List(i.compute, opts)
|
||||
|
||||
ret := make([]types.NodeName, 0)
|
||||
err := pager.EachPage(func(page pagination.Page) (bool, error) {
|
||||
sList, err := servers.ExtractServers(page)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
for i := range sList {
|
||||
ret = append(ret, mapServerToNodeName(&sList[i]))
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
glog.V(3).Infof("Found %v instances matching %v: %v",
|
||||
len(ret), name_filter, ret)
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// Implementation of Instances.CurrentNodeName
|
||||
// Note this is *not* necessarily the same as hostname.
|
||||
func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user