summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-12 11:08:22 -0400
committerGitHub <noreply@github.com>2020-10-12 11:08:22 -0400
commite8f48a11b6100c6d0ec21366c66a95fd7abfd154 (patch)
tree977a55cad6a85956d3d95d414eda383a758f9ba0 /libpod
parent212011f166d6f56421fcc5260def999e71156d32 (diff)
parent77033c4aed90b15a567d12036ec636c53e2c8e15 (diff)
downloadpodman-e8f48a11b6100c6d0ec21366c66a95fd7abfd154.tar.gz
podman-e8f48a11b6100c6d0ec21366c66a95fd7abfd154.tar.bz2
podman-e8f48a11b6100c6d0ec21366c66a95fd7abfd154.zip
Merge pull request #7983 from mheon/inspect_network_not_running
Include CNI networks in inspect output when not running
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index d16bdc973..f87c311ce 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -828,6 +828,17 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
// We can't do more if the network is down.
if c.state.NetNS == nil {
+ // We still want to make dummy configurations for each CNI net
+ // the container joined.
+ if len(c.config.Networks) > 0 {
+ settings.Networks = make(map[string]*define.InspectAdditionalNetwork, len(c.config.Networks))
+ for _, net := range c.config.Networks {
+ cniNet := new(define.InspectAdditionalNetwork)
+ cniNet.NetworkID = net
+ settings.Networks[net] = cniNet
+ }
+ }
+
return settings, nil
}