Unverified Commit b2613f15 authored by TigerXu's avatar TigerXu Committed by GitHub

Revert "no need delete endpoint explicitly in endpoint controller"

parent a19f6d14
......@@ -394,7 +394,15 @@ func (e *EndpointController) syncService(key string) error {
}
service, err := e.serviceLister.Services(namespace).Get(name)
if err != nil {
// Service has been deleted. So no need to do any more operations.
// Delete the corresponding endpoint, as the service has been deleted.
// TODO: Please note that this will delete an endpoint when a
// service is deleted. However, if we're down at the time when
// the service is deleted, we will miss that deletion, so this
// doesn't completely solve the problem. See #6877.
err = e.client.CoreV1().Endpoints(namespace).Delete(name, nil)
if err != nil && !errors.IsNotFound(err) {
return err
}
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment