summaryrefslogtreecommitdiff
path: root/libpod/network/internal/util/validate.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-10-20 15:55:22 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-11-11 16:25:19 +0100
commit4febe557692aeec8ca9d9b9cdc732772ba7d5876 (patch)
tree0d8bd9c4d3809ca099315fb2437ece00690260be /libpod/network/internal/util/validate.go
parenteaae29462880aa0fb17e8d448cc79519e070e64f (diff)
downloadpodman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.tar.gz
podman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.tar.bz2
podman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.zip
netavark IPAM assignment
Add a new boltdb to handle IPAM assignment. The db structure is the following: Each network has their own bucket with the network name as bucket key. Inside the network bucket there is an ID bucket which maps the container ID (key) to a json array of ip addresses (value). The network bucket also has a bucket for each subnet, the subnet is used as key. Inside the subnet bucket an ip is used as key and the container ID as value. The db should be stored on a tmpfs to ensure we always have a clean state after a reboot. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/internal/util/validate.go')
-rw-r--r--libpod/network/internal/util/validate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/network/internal/util/validate.go b/libpod/network/internal/util/validate.go
index 4dced8631..62c3f3951 100644
--- a/libpod/network/internal/util/validate.go
+++ b/libpod/network/internal/util/validate.go
@@ -38,7 +38,7 @@ func ValidateSubnet(s *types.Subnet, addGateway bool, usedNetworks []*net.IPNet)
if !s.Subnet.Contains(s.Gateway) {
return errors.Errorf("gateway %s not in subnet %s", s.Gateway, &s.Subnet)
}
- NormalizeIP(&s.Gateway)
+ util.NormalizeIP(&s.Gateway)
} else if addGateway {
ip, err := util.FirstIPInSubnet(net)
if err != nil {
@@ -52,13 +52,13 @@ func ValidateSubnet(s *types.Subnet, addGateway bool, usedNetworks []*net.IPNet)
if !s.Subnet.Contains(s.LeaseRange.StartIP) {
return errors.Errorf("lease range start ip %s not in subnet %s", s.LeaseRange.StartIP, &s.Subnet)
}
- NormalizeIP(&s.LeaseRange.StartIP)
+ util.NormalizeIP(&s.LeaseRange.StartIP)
}
if s.LeaseRange.EndIP != nil {
if !s.Subnet.Contains(s.LeaseRange.EndIP) {
return errors.Errorf("lease range end ip %s not in subnet %s", s.LeaseRange.EndIP, &s.Subnet)
}
- NormalizeIP(&s.LeaseRange.EndIP)
+ util.NormalizeIP(&s.LeaseRange.EndIP)
}
}
return nil