Addded a StoreToServiceLister.

pull/6/head
Eric Tune 2015-01-07 08:17:30 -08:00
parent 50b5bb41f4
commit 83aed75556
1 changed files with 14 additions and 2 deletions

View File

@ -74,5 +74,17 @@ func (s *StoreToNodeLister) GetNodeInfo(id string) (*api.Node, error) {
return nil, fmt.Errorf("minion '%v' is not in cache", id)
}
// TODO: add StoreToServiceLister for use in kube-proxy and kubelet.
// TODO: add StoreToServiceLister for use in kube-proxy.
// StoreToServiceLister makes a Store have the List method of the client.ServiceInterface
// 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.