mirror of
https://github.com/moby/moby.git
synced 2026-08-08 09:01:44 +00:00
Report endpoint id as well as name in ActiveEndpointsError
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -1048,9 +1048,11 @@ func (n *Network) delete(force bool, rmLBEndpoint bool) error {
|
||||
eps := c.findEndpoints(filterEndpointByNetworkId(n.id))
|
||||
if !force && len(eps) > emptyCount {
|
||||
return &ActiveEndpointsError{
|
||||
name: n.name,
|
||||
id: n.id,
|
||||
endpoints: sliceutil.Map(eps, func(ep *Endpoint) string { return ep.name }),
|
||||
name: n.name,
|
||||
id: n.id,
|
||||
endpoints: sliceutil.Map(eps, func(ep *Endpoint) string {
|
||||
return fmt.Sprintf(`name:"%s" id:"%s"`, ep.name, stringid.TruncateID(ep.id))
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user