Also handle service update in endpoints.go
This commit is contained in:
parent
3d0fb0cf17
commit
eb10ff9871
|
@ -111,9 +111,18 @@ func (e *Endpoints) Run(ctx context.Context, ch chan<- []*config.TargetGroup) {
|
||||||
e.serviceInf.AddEventHandler(cache.ResourceEventHandlerFuncs{
|
e.serviceInf.AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||||
// TODO(fabxc): potentially remove add and delete event handlers. Those should
|
// TODO(fabxc): potentially remove add and delete event handlers. Those should
|
||||||
// be triggered via the endpoint handlers already.
|
// be triggered via the endpoint handlers already.
|
||||||
AddFunc: func(o interface{}) { serviceUpdate(o.(*apiv1.Service)) },
|
AddFunc: func(o interface{}) {
|
||||||
UpdateFunc: func(_, o interface{}) { serviceUpdate(o.(*apiv1.Service)) },
|
eventCount.WithLabelValues("service", "add").Inc()
|
||||||
DeleteFunc: func(o interface{}) { serviceUpdate(o.(*apiv1.Service)) },
|
serviceUpdate(o.(*apiv1.Service))
|
||||||
|
},
|
||||||
|
UpdateFunc: func(_, o interface{}) {
|
||||||
|
eventCount.WithLabelValues("service", "update").Inc()
|
||||||
|
serviceUpdate(o.(*apiv1.Service))
|
||||||
|
},
|
||||||
|
DeleteFunc: func(o interface{}) {
|
||||||
|
eventCount.WithLabelValues("service", "delete").Inc()
|
||||||
|
serviceUpdate(o.(*apiv1.Service))
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// Block until the target provider is explicitly canceled.
|
// Block until the target provider is explicitly canceled.
|
||||||
|
|
Loading…
Reference in New Issue