Unverified Commit a052159b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #57747 from hzxuzhonghu/ep-cm

Automatic merge from submit-queue (batch tested with PRs 57747, 57749). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. no need delete endpoint explicitly in endpoint controller **What this PR does / why we need it**: It is no need to do delete in controller. Because in service restStorage, endpoint is deleted when delete service. See https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/core/service/rest.go#L170~L180 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #57745 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents ff584012 ad067470
...@@ -394,15 +394,7 @@ func (e *EndpointController) syncService(key string) error { ...@@ -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
} }
......
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