From ad0674702713fc36ebe53c99f2bab1d54d7a82ff Mon Sep 17 00:00:00 2001 From: hzxuzhonghu Date: Tue, 2 Jan 2018 20:35:30 +0800 Subject: [PATCH] remove redundant deleting endpoint explicitly in endpoint controller --- pkg/controller/endpoint/endpoints_controller.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index 8aa41da8a83..b7d46c3e07e 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -394,15 +394,7 @@ func (e *EndpointController) syncService(key string) error { } service, err := e.serviceLister.Services(namespace).Get(name) if err != nil { - // 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 - } + // Service has been deleted. So no need to do any more operations. return nil }