diff --git a/pkg/ipam/subnet.go b/pkg/ipam/subnet.go index c86cbc460aa..2313a1c7c20 100644 --- a/pkg/ipam/subnet.go +++ b/pkg/ipam/subnet.go @@ -285,6 +285,11 @@ func (subnet *Subnet) GetStaticAddress(podName string, ip IP, mac string, force if v4 && !subnet.V4CIDR.Contains(net.ParseIP(string(ip))) { return ip, mac, OutOfRangeError } + + if v6 { + ip = IP(net.ParseIP(string(ip)).String()) + } + if v6 && !subnet.V6CIDR.Contains(net.ParseIP(string(ip))) { return ip, mac, OutOfRangeError }