Skip to content

Commit b1d8e0b

Browse files
author
Rajat Chopra
committed
empty the pool, or delete the pool when endpoints are deleted
1 parent afb4f8d commit b1d8e0b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/router/f5/plugin.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,21 @@ func (p *F5Plugin) HandleEndpoints(eventType watch.EventType,
295295
return err
296296
}
297297
}
298+
case watch.Deleted:
299+
poolname := poolName(endpoints.Namespace, endpoints.Name)
300+
// presumably, the endpoints are a nil subnet now, reset it anyway
301+
endpoints.Subsets = nil
302+
err := p.updatePool(poolname, endpoints)
303+
if err != nil {
304+
return err
305+
}
306+
307+
glog.V(4).Infof("Deleting pool %s", poolname)
308+
309+
err = p.deletePool(poolname)
310+
if err != nil {
311+
return err
312+
}
298313
}
299314

300315
glog.V(4).Infof("Done processing Endpoints for Name: %v.", endpoints.Name)

0 commit comments

Comments
 (0)