From d8910dc535edf271f3e4e8772fc6a46144fe6400 Mon Sep 17 00:00:00 2001 From: Chris Telfer Date: Thu, 31 May 2018 14:21:55 -0400 Subject: [PATCH] Remove non-service cluster info on sbLeave The system should remove cluster service info including networkDB entries and DNS entries for container endpoints that are not part of a service as well as those that are part of a service. This used to be the normal sequence of operations but it moved to sandbox.DisableService() in an effort to more gracefully handle endpoint removal from a service (which proved insufficient). Unfortunately subsequent changes also removed the newly-mandetory call to sandbox.DisableService() preventing proper cleanup for non-service container endpoints. Signed-off-by: Chris Telfer --- endpoint.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/endpoint.go b/endpoint.go index c92db55f39..e245786475 100644 --- a/endpoint.go +++ b/endpoint.go @@ -752,10 +752,8 @@ func (ep *endpoint) sbLeave(sb *sandbox, force bool, options ...EndpointOption) } } - if ep.svcID != "" { - if err := ep.deleteServiceInfoFromCluster(sb, true, "sbLeave"); err != nil { - logrus.Warnf("Failed to clean up service info on container %s disconnect: %v", ep.name, err) - } + if err := ep.deleteServiceInfoFromCluster(sb, true, "sbLeave"); err != nil { + logrus.Warnf("Failed to clean up service info on container %s disconnect: %v", ep.name, err) } if err := sb.clearNetworkResources(ep); err != nil {