Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addded a StoreToServiceLister. #3346

Merged
merged 1 commit into from
Jan 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions pkg/client/cache/listers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.