Normally Ingress sinchronization for Services is triggered when corresponding Service's Endpoints are added, deleted or modified. Services of type ExternalName, however, do not have any endpoints and hence do not trigger Ingress synchronization as only Update events are being watched. This commit makes sure that Update and Delete Service events also enqueue a syncIngress task.
This commit is contained in:
parent
3c86f838d4
commit
af5f40a0eb
2 changed files with 88 additions and 54 deletions
|
|
@ -660,6 +660,24 @@ func New(
|
|||
}
|
||||
|
||||
serviceHandler := cache.ResourceEventHandlerFuncs{
|
||||
AddFunc: func(obj interface{}) {
|
||||
svc := obj.(*corev1.Service)
|
||||
if svc.Spec.Type == corev1.ServiceTypeExternalName {
|
||||
updateCh.In() <- Event{
|
||||
Type: CreateEvent,
|
||||
Obj: obj,
|
||||
}
|
||||
}
|
||||
},
|
||||
DeleteFunc: func(obj interface{}) {
|
||||
svc := obj.(*corev1.Service)
|
||||
if svc.Spec.Type == corev1.ServiceTypeExternalName {
|
||||
updateCh.In() <- Event{
|
||||
Type: DeleteEvent,
|
||||
Obj: obj,
|
||||
}
|
||||
}
|
||||
},
|
||||
UpdateFunc: func(old, cur interface{}) {
|
||||
oldSvc := old.(*corev1.Service)
|
||||
curSvc := cur.(*corev1.Service)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue