summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-20 22:07:32 +0100
committerGitHub <noreply@github.com>2020-11-20 22:07:32 +0100
commitb4b4fa07a97560085bfedbf0498a9301eb815435 (patch)
tree18b0d26b34d8d4455ede7b487fce46be78da1910 /libpod/container_internal.go
parent41c88a66080c88d9855c422aed4bf30464e94126 (diff)
parentce775248ada62c117dd5303989052b268e6594bd (diff)
downloadpodman-b4b4fa07a97560085bfedbf0498a9301eb815435.tar.gz
podman-b4b4fa07a97560085bfedbf0498a9301eb815435.tar.bz2
podman-b4b4fa07a97560085bfedbf0498a9301eb815435.zip
Merge pull request #8431 from mheon/networks_returns_default
Make c.networks() list include the default network
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 108954bad..823e5fb3a 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -641,18 +641,13 @@ func (c *Container) removeIPv4Allocations() error {
cniDefaultNetwork = c.runtime.netPlugin.GetDefaultNetworkName()
}
- networks, err := c.networks()
+ networks, _, err := c.networks()
if err != nil {
return err
}
- switch {
- case len(networks) > 0 && len(networks) != len(c.state.NetworkStatus):
+ if len(networks) != len(c.state.NetworkStatus) {
return errors.Wrapf(define.ErrInternal, "network mismatch: asked to join %d CNI networks but got %d CNI results", len(networks), len(c.state.NetworkStatus))
- case len(networks) == 0 && len(c.state.NetworkStatus) != 1:
- return errors.Wrapf(define.ErrInternal, "network mismatch: did not specify CNI networks but joined more than one (%d)", len(c.state.NetworkStatus))
- case len(networks) == 0 && cniDefaultNetwork == "":
- return errors.Wrapf(define.ErrInternal, "could not retrieve name of CNI default network")
}
for index, result := range c.state.NetworkStatus {