kube-proxy: some code cleanup
This commit is contained in:
@@ -621,18 +621,26 @@ func (proxier *Proxier) serviceChange(previous, current *v1.Service, detail stri
|
||||
}
|
||||
}
|
||||
|
||||
// OnServiceAdd is called whenever creation of new service object
|
||||
// is observed.
|
||||
func (proxier *Proxier) OnServiceAdd(service *v1.Service) {
|
||||
proxier.serviceChange(nil, service, "OnServiceAdd")
|
||||
}
|
||||
|
||||
// OnServiceUpdate is called whenever modification of an existing
|
||||
// service object is observed.
|
||||
func (proxier *Proxier) OnServiceUpdate(oldService, service *v1.Service) {
|
||||
proxier.serviceChange(oldService, service, "OnServiceUpdate")
|
||||
}
|
||||
|
||||
// OnServiceDelete is called whenever deletion of an existing service
|
||||
// object is observed.
|
||||
func (proxier *Proxier) OnServiceDelete(service *v1.Service) {
|
||||
proxier.serviceChange(service, nil, "OnServiceDelete")
|
||||
}
|
||||
|
||||
// OnServiceSynced is called once all the initial event handlers were
|
||||
// called and the state is fully propagated to local cache.
|
||||
func (proxier *Proxier) OnServiceSynced() {
|
||||
klog.V(2).Infof("userspace OnServiceSynced")
|
||||
|
||||
@@ -649,18 +657,26 @@ func (proxier *Proxier) OnServiceSynced() {
|
||||
go proxier.syncProxyRules()
|
||||
}
|
||||
|
||||
// OnEndpointsAdd is called whenever creation of new endpoints object
|
||||
// is observed.
|
||||
func (proxier *Proxier) OnEndpointsAdd(endpoints *v1.Endpoints) {
|
||||
proxier.loadBalancer.OnEndpointsAdd(endpoints)
|
||||
}
|
||||
|
||||
// OnEndpointsUpdate is called whenever modification of an existing
|
||||
// endpoints object is observed.
|
||||
func (proxier *Proxier) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoints) {
|
||||
proxier.loadBalancer.OnEndpointsUpdate(oldEndpoints, endpoints)
|
||||
}
|
||||
|
||||
// OnEndpointsDelete is called whenever deletion of an existing endpoints
|
||||
// object is observed.
|
||||
func (proxier *Proxier) OnEndpointsDelete(endpoints *v1.Endpoints) {
|
||||
proxier.loadBalancer.OnEndpointsDelete(endpoints)
|
||||
}
|
||||
|
||||
// OnEndpointsSynced is called once all the initial event handlers were
|
||||
// called and the state is fully propagated to local cache.
|
||||
func (proxier *Proxier) OnEndpointsSynced() {
|
||||
klog.V(2).Infof("userspace OnEndpointsSynced")
|
||||
proxier.loadBalancer.OnEndpointsSynced()
|
||||
|
||||
Reference in New Issue
Block a user