summaryrefslogtreecommitdiff
path: root/libpod/network/cni/run_test.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-08-26 15:06:38 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-15 18:05:26 +0200
commit24bec9a76bcc2d8e93670047ed0ee8c16d9d7620 (patch)
tree4f8d62e7f104a1a877651acf77eef291ec71c5f6 /libpod/network/cni/run_test.go
parentaa7bc4e37168e4cdb4469ba8b728d7f5157e46b5 (diff)
downloadpodman-24bec9a76bcc2d8e93670047ed0ee8c16d9d7620.tar.gz
podman-24bec9a76bcc2d8e93670047ed0ee8c16d9d7620.tar.bz2
podman-24bec9a76bcc2d8e93670047ed0ee8c16d9d7620.zip
default network: do not validate the used subnets
The default network should not be validated against used subnets, we have to ensure that this network can always be created even when a subnet is already used on the host. This could happen if you run a container on this net, then the cni interface will be created on the host and "block" this subnet from being used again. Therefore the next podman command tries to create the default net again and it would fail because it thinks the network is used on the host. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/cni/run_test.go')
-rw-r--r--libpod/network/cni/run_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/network/cni/run_test.go b/libpod/network/cni/run_test.go
index 32e88ca61..f6da22a76 100644
--- a/libpod/network/cni/run_test.go
+++ b/libpod/network/cni/run_test.go
@@ -140,6 +140,10 @@ var _ = Describe("run CNI", func() {
Expect(res[defNet].DNSServerIPs).To(BeEmpty())
Expect(res[defNet].DNSSearchDomains).To(BeEmpty())
+ // reload the interface so the networks are reload from disk
+ libpodNet, err := getNetworkInterface(cniConfDir, false)
+ Expect(err).To(BeNil())
+
err = libpodNet.Teardown(netNSContainer.Path(), types.TeardownOptions(setupOpts))
Expect(err).To(BeNil())
})