mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Addded a StoreToServiceLister.
This commit is contained in:
parent
50b5bb41f4
commit
83aed75556
16
pkg/client/cache/listers.go
vendored
16
pkg/client/cache/listers.go
vendored
@ -74,5 +74,17 @@ func (s *StoreToNodeLister) GetNodeInfo(id string) (*api.Node, error) {
|
|||||||
return nil, fmt.Errorf("minion '%v' is not in cache", id)
|
return nil, fmt.Errorf("minion '%v' is not in cache", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add StoreToServiceLister for use in kube-proxy and kubelet.
|
// StoreToServiceLister makes a Store have the List method of the client.ServiceInterface
|
||||||
// TODO: add StoreToServiceLister for use in kube-proxy.
|
// The Store must contain (only) Services.
|
||||||
|
type StoreToServiceLister struct {
|
||||||
|
Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *StoreToServiceLister) List() (svcs api.ServiceList, err error) {
|
||||||
|
for _, m := range s.Store.List() {
|
||||||
|
svcs.Items = append(svcs.Items, *(m.(*api.Service)))
|
||||||
|
}
|
||||||
|
return svcs, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: add StoreToEndpointsLister for use in kube-proxy.
|
||||||
|
Loading…
Reference in New Issue
Block a user