From 4cc65d01a60542292ffd9a86f9f8a15b1714baa6 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Sat, 24 Oct 2015 13:31:01 -0700 Subject: [PATCH] Clean hosts entries on endpoint leave - Currently when a sandbox disconnect from a network the network's services are not removed from the sandbox's /etc/hosts file Signed-off-by: Alessandro Boch --- libnetwork/endpoint.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnetwork/endpoint.go b/libnetwork/endpoint.go index 4ec244e70b..4288366a8a 100644 --- a/libnetwork/endpoint.go +++ b/libnetwork/endpoint.go @@ -512,6 +512,8 @@ func (ep *endpoint) sbLeave(sbox Sandbox, options ...EndpointOption) error { return err } + sb.deleteHostsEntries(n.getSvcRecords(ep)) + if sb.needDefaultGW() { ep := sb.getEPwithoutGateway() if ep == nil {