diff options
Diffstat (limited to 'libpod/network')
-rw-r--r-- | libpod/network/cni/cni_conversion.go | 3 | ||||
-rw-r--r-- | libpod/network/cni/config_test.go | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libpod/network/cni/cni_conversion.go b/libpod/network/cni/cni_conversion.go index 09943948b..060794ebe 100644 --- a/libpod/network/cni/cni_conversion.go +++ b/libpod/network/cni/cni_conversion.go @@ -185,6 +185,9 @@ func convertIPAMConfToNetwork(network *types.Network, ipam ipamConfig, confPath s.LeaseRange.StartIP = rangeStart s.LeaseRange.EndIP = rangeEnd } + if util.IsIPv6(s.Subnet.IP) { + network.IPv6Enabled = true + } network.Subnets = append(network.Subnets, s) } } diff --git a/libpod/network/cni/config_test.go b/libpod/network/cni/config_test.go index 2465f1d1c..11ad71870 100644 --- a/libpod/network/cni/config_test.go +++ b/libpod/network/cni/config_test.go @@ -313,6 +313,14 @@ var _ = Describe("Config", func() { Expect(network1.Subnets[0].Subnet.String()).To(Equal(subnet)) Expect(network1.Subnets[0].Gateway.String()).To(Equal("fdcc::1")) Expect(network1.Subnets[0].LeaseRange).To(BeNil()) + + // reload configs from disk + libpodNet, err = getNetworkInterface(cniConfDir, false) + Expect(err).To(BeNil()) + // check the the networks are identical + network2, err := libpodNet.NetworkInspect(network1.Name) + Expect(err).To(BeNil()) + Expect(network1).To(Equal(network2)) }) It("create bridge with ipv6 enabled", func() { |