Services and Endpoints weren't properly sync'ing

They need incremental changes and a resync on start.
This commit is contained in:
Clayton Coleman
2014-08-28 22:31:41 -04:00
parent 6c5568261e
commit 01e668187c
14 changed files with 326 additions and 30 deletions

View File

@@ -27,10 +27,11 @@ func NewServiceRegistry() *ServiceRegistry {
}
type ServiceRegistry struct {
List api.ServiceList
Service *api.Service
Err error
Endpoints api.Endpoints
List api.ServiceList
Service *api.Service
Err error
Endpoints api.Endpoints
EndpointsList api.EndpointsList
DeletedID string
GottenID string
@@ -66,6 +67,10 @@ func (r *ServiceRegistry) WatchServices(label, field labels.Selector, resourceVe
return nil, r.Err
}
func (r *ServiceRegistry) ListEndpoints() (*api.EndpointsList, error) {
return &r.EndpointsList, r.Err
}
func (r *ServiceRegistry) GetEndpoints(id string) (*api.Endpoints, error) {
r.GottenID = id
return &r.Endpoints, r.Err