Skip to content

Commit 901c67a

Browse files
committed
Merge pull request moby#21160 from mavenugo/staleep
Include all endpoints in network inspect object
2 parents d4a4cb9 + 2ef00ba commit 901c67a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

api/server/router/network/network_routes.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ func buildNetworkResource(nw libnetwork.Network) *types.NetworkResource {
181181
continue
182182
}
183183
sb := ei.Sandbox()
184-
if sb == nil {
185-
continue
184+
key := "ep-" + e.ID()
185+
if sb != nil {
186+
key = sb.ContainerID()
186187
}
187188

188-
r.Containers[sb.ContainerID()] = buildEndpointResource(e)
189+
r.Containers[key] = buildEndpointResource(e)
189190
}
190191
return r
191192
}

docs/reference/commandline/network_inspect.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727
2828
```
2929

3030
The `network inspect` command shows the containers, by id, in its
31-
results. You can specify an alternate format to execute a given
31+
results. For networks backed by multi-host network driver, such as Overlay,
32+
this command also shows the container endpoints in other hosts in the
33+
cluster. These endpoints are represented as "ep-{endpoint-id}" in the output.
34+
You can specify an alternate format to execute a given
3235
template for each result. Go's
3336
[text/template](http://golang.org/pkg/text/template/) package describes all the
3437
details of the format.

0 commit comments

Comments
 (0)