mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
port endpoints to generic etcd
This commit is contained in:
@@ -91,3 +91,7 @@ func (e *EndpointRegistry) UpdateEndpoints(ctx api.Context, endpoints *api.Endpo
|
||||
e.Endpoints.Items = append(e.Endpoints.Items, *endpoints)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *EndpointRegistry) DeleteEndpoints(ctx api.Context, name string) error {
|
||||
return fmt.Errorf("unimplemented!")
|
||||
}
|
||||
|
@@ -30,12 +30,10 @@ func NewServiceRegistry() *ServiceRegistry {
|
||||
}
|
||||
|
||||
type ServiceRegistry struct {
|
||||
mu sync.Mutex
|
||||
List api.ServiceList
|
||||
Service *api.Service
|
||||
Err error
|
||||
Endpoints api.Endpoints
|
||||
EndpointsList api.EndpointsList
|
||||
mu sync.Mutex
|
||||
List api.ServiceList
|
||||
Service *api.Service
|
||||
Err error
|
||||
|
||||
DeletedID string
|
||||
GottenID string
|
||||
@@ -114,33 +112,3 @@ func (r *ServiceRegistry) WatchServices(ctx api.Context, label labels.Selector,
|
||||
|
||||
return nil, r.Err
|
||||
}
|
||||
|
||||
func (r *ServiceRegistry) ListEndpoints(ctx api.Context) (*api.EndpointsList, error) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
return &r.EndpointsList, r.Err
|
||||
}
|
||||
|
||||
func (r *ServiceRegistry) GetEndpoints(ctx api.Context, id string) (*api.Endpoints, error) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
r.GottenID = id
|
||||
return &r.Endpoints, r.Err
|
||||
}
|
||||
|
||||
func (r *ServiceRegistry) UpdateEndpoints(ctx api.Context, e *api.Endpoints) error {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
r.Endpoints = *e
|
||||
return r.Err
|
||||
}
|
||||
|
||||
func (r *ServiceRegistry) WatchEndpoints(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
|
||||
return nil, r.Err
|
||||
}
|
||||
|
Reference in New Issue
Block a user