浏览代码

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 <aboch@docker.com>
Alessandro Boch 9 年之前
父节点
当前提交
4cc65d01a6
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      libnetwork/endpoint.go

+ 2 - 0
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 {