Expose REST resource for endpoints and watch on services/endpoints

Will allow kube-proxies to listen on endpoints.
This commit is contained in:
Clayton Coleman
2014-08-14 15:48:34 -04:00
parent b5e1e044bc
commit 083d81b6d7
10 changed files with 483 additions and 3 deletions

View File

@@ -18,6 +18,8 @@ package registrytest
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)
func NewServiceRegistry() *ServiceRegistry {
@@ -60,7 +62,19 @@ func (r *ServiceRegistry) UpdateService(svc api.Service) error {
return r.Err
}
func (r *ServiceRegistry) WatchServices(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
return nil, r.Err
}
func (r *ServiceRegistry) GetEndpoints(name string) (*api.Endpoints, error) {
return &r.Endpoints, r.Err
}
func (r *ServiceRegistry) UpdateEndpoints(e api.Endpoints) error {
r.Endpoints = e
return r.Err
}
func (r *ServiceRegistry) WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
return nil, r.Err
}