mirror of https://github.com/containers/podman.git
cni network configs set ipv6 enables correctly
When configs are loaded from disk we need to check if they contain a ipv6 subnet and set ipv6 enables to true in this case. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
24bec9a76b
commit
218f132fdf
|
@ -185,6 +185,9 @@ func convertIPAMConfToNetwork(network *types.Network, ipam ipamConfig, confPath
|
||||||
s.LeaseRange.StartIP = rangeStart
|
s.LeaseRange.StartIP = rangeStart
|
||||||
s.LeaseRange.EndIP = rangeEnd
|
s.LeaseRange.EndIP = rangeEnd
|
||||||
}
|
}
|
||||||
|
if util.IsIPv6(s.Subnet.IP) {
|
||||||
|
network.IPv6Enabled = true
|
||||||
|
}
|
||||||
network.Subnets = append(network.Subnets, s)
|
network.Subnets = append(network.Subnets, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,6 +313,14 @@ var _ = Describe("Config", func() {
|
||||||
Expect(network1.Subnets[0].Subnet.String()).To(Equal(subnet))
|
Expect(network1.Subnets[0].Subnet.String()).To(Equal(subnet))
|
||||||
Expect(network1.Subnets[0].Gateway.String()).To(Equal("fdcc::1"))
|
Expect(network1.Subnets[0].Gateway.String()).To(Equal("fdcc::1"))
|
||||||
Expect(network1.Subnets[0].LeaseRange).To(BeNil())
|
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() {
|
It("create bridge with ipv6 enabled", func() {
|
||||||
|
|
Loading…
Reference in New Issue