summaryrefslogtreecommitdiff
path: root/libpod/network/network.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-07-26 13:59:29 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-07-26 14:05:33 +0200
commit8d5d5face5198b1024d85acbd497b5a0c6b6f4dc (patch)
tree563a772912c92c8fa4538d42faa969c8334a216b /libpod/network/network.go
parent21e1c3175dda40b8fd54985335b4152fe6a6cbd5 (diff)
downloadpodman-8d5d5face5198b1024d85acbd497b5a0c6b6f4dc.tar.gz
podman-8d5d5face5198b1024d85acbd497b5a0c6b6f4dc.tar.bz2
podman-8d5d5face5198b1024d85acbd497b5a0c6b6f4dc.zip
dual-stack network: fix duplicated subnet assignment
Make sure podman network create reads all subnets from existing cni configs and not only the first one. Fixes #11032 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/network.go')
-rw-r--r--libpod/network/network.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/network/network.go b/libpod/network/network.go
index ed4e6388a..805988432 100644
--- a/libpod/network/network.go
+++ b/libpod/network/network.go
@@ -111,8 +111,10 @@ func allocatorToIPNets(networks []*allocator.Net) []*net.IPNet {
if len(network.IPAM.Ranges) > 0 {
// this is the new IPAM range style
// append each subnet from ipam the rangeset
- for _, r := range network.IPAM.Ranges[0] {
- nets = append(nets, newIPNetFromSubnet(r.Subnet))
+ for _, allocatorRange := range network.IPAM.Ranges {
+ for _, r := range allocatorRange {
+ nets = append(nets, newIPNetFromSubnet(r.Subnet))
+ }
}
} else {
// looks like the old, deprecated style