diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-27 09:31:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 09:31:15 +0100 |
commit | 2102e26506f392499b78297d25e24d591dee3bc8 (patch) | |
tree | cce7e76231cb2a109e81d043372392eade965a14 /libpod | |
parent | c3b39842ce76e3e3bfc843abfebeeb603f04591d (diff) | |
parent | 02ec5299f619494d9e194492b6d3266daf0a5a6c (diff) | |
download | podman-2102e26506f392499b78297d25e24d591dee3bc8.tar.gz podman-2102e26506f392499b78297d25e24d591dee3bc8.tar.bz2 podman-2102e26506f392499b78297d25e24d591dee3bc8.zip |
Merge pull request #9109 from mheon/issue6618
Fix #6618
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/networking_linux.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index ef2f034ab..737dbf935 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -977,7 +977,7 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e if c.state.NetNS == nil { // We still want to make dummy configurations for each CNI net // the container joined. - if len(networks) > 0 && !isDefault { + if len(networks) > 0 { settings.Networks = make(map[string]*define.InspectAdditionalNetwork, len(networks)) for _, net := range networks { cniNet := new(define.InspectAdditionalNetwork) @@ -998,7 +998,7 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e } // If we have CNI networks - handle that here - if len(networks) > 0 && !isDefault { + if len(networks) > 0 { if len(networks) != len(c.state.NetworkStatus) { return nil, errors.Wrapf(define.ErrInternal, "network inspection mismatch: asked to join %d CNI network(s) %v, but have information on %d network(s)", len(networks), networks, len(c.state.NetworkStatus)) } @@ -1028,7 +1028,9 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e settings.Networks[name] = addedNet } - return settings, nil + if !isDefault { + return settings, nil + } } // If not joining networks, we should have at most 1 result |