remove redundant deleting endpoint explicitly in endpoint controller

This commit is contained in:
hzxuzhonghu 2018-01-02 20:35:30 +08:00
parent da9a4d5da9
commit ad06747027

View File

@ -394,15 +394,7 @@ func (e *EndpointController) syncService(key string) error {
} }
service, err := e.serviceLister.Services(namespace).Get(name) service, err := e.serviceLister.Services(namespace).Get(name)
if err != nil { if err != nil {
// Delete the corresponding endpoint, as the service has been deleted. // Service has been deleted. So no need to do any more operations.
// 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 return nil
} }