mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Refactor pkg/proxy/config's ServiceConfigHandler and EndpointsConfigHandler to have different update methods.
Refactor `pkg/proxy/config`’s ServiceConfigHandler.OnUpdate and EndpointsConfigHandler.OnUpdate to different method names as they have different signatures. This will let the new proxy (https://github.com/GoogleCloudPlatform/kubernetes/issues/3760) implement both interfaces. Since we won’t need a separate loadbalancer structure (load balancing is handled in the proxy rules), we will simply handle both event types from the same object.
This commit is contained in:
@@ -57,7 +57,7 @@ func NewServiceHandlerMock() *ServiceHandlerMock {
|
||||
return &ServiceHandlerMock{services: make([]api.Service, 0)}
|
||||
}
|
||||
|
||||
func (h *ServiceHandlerMock) OnUpdate(services []api.Service) {
|
||||
func (h *ServiceHandlerMock) OnServiceUpdate(services []api.Service) {
|
||||
sort.Sort(sortedServices(services))
|
||||
h.services = services
|
||||
h.updated.Done()
|
||||
@@ -95,7 +95,7 @@ func NewEndpointsHandlerMock() *EndpointsHandlerMock {
|
||||
return &EndpointsHandlerMock{endpoints: make([]api.Endpoints, 0)}
|
||||
}
|
||||
|
||||
func (h *EndpointsHandlerMock) OnUpdate(endpoints []api.Endpoints) {
|
||||
func (h *EndpointsHandlerMock) OnEndpointsUpdate(endpoints []api.Endpoints) {
|
||||
sort.Sort(sortedEndpoints(endpoints))
|
||||
h.endpoints = endpoints
|
||||
h.updated.Done()
|
||||
|
||||
Reference in New Issue
Block a user