summaryrefslogtreecommitdiff
path: root/libpod/networking_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-29 17:30:41 -0500
committerGitHub <noreply@github.com>2021-01-29 17:30:41 -0500
commit745fa4ac94c3ec99becd85f59d1b59c2c9765527 (patch)
tree63f32aeeb816a637e9406217a4044ff91031cd31 /libpod/networking_linux.go
parentb6336071101fe4f19a7826d16f0dd61394678853 (diff)
parentc1f05be4d7ac31c741a9ea542e284d731c6544a1 (diff)
downloadpodman-745fa4ac94c3ec99becd85f59d1b59c2c9765527.tar.gz
podman-745fa4ac94c3ec99becd85f59d1b59c2c9765527.tar.bz2
podman-745fa4ac94c3ec99becd85f59d1b59c2c9765527.zip
Merge pull request #9163 from mheon/backports_rc2
Backports for v3.0 RC2
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r--libpod/networking_linux.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index addf1814c..94b8563fe 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -955,7 +955,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)
@@ -976,7 +976,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))
}
@@ -1006,7 +1006,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