spiegel_podman/libpod/network/cni
Paul Holzinger 31df5b78fc rootful: do not set XDG_RUNTIME_DIR for cni plugins
The dnsname plugin tries to use XDG_RUNTIME_DIR to store files.
podman run will have XDG_RUNTIME_DIR set and thus the cni plugin can use
it. The problem is that XDG_RUNTIME_DIR is unset for the conmon process
for rootful users. This causes issues since the cleanup process is spawned
by conmon and thus not have XDG_RUNTIME_DIR set to same value as podman run.

Because of it dnsname will not find the config files and cannot correctly
cleanup.
To fix this we should also unset XDG_RUNTIME_DIR for the cni plugins as
rootful.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-29 16:39:29 -04:00
..
testfiles Network interface 2021-08-24 12:28:03 +02:00
cni_conversion.go Network interface 2021-08-24 12:28:03 +02:00
cni_exec.go rootful: do not set XDG_RUNTIME_DIR for cni plugins 2021-09-29 16:39:29 -04:00
cni_suite_test.go Network interface 2021-08-24 12:28:03 +02:00
cni_types.go Network interface 2021-08-24 12:28:03 +02:00
config.go Network interface 2021-08-24 12:28:03 +02:00
config_test.go Network interface 2021-08-24 12:28:03 +02:00
network.go Network interface 2021-08-24 12:28:03 +02:00
README.md Network interface 2021-08-24 12:28:03 +02:00
run.go Network interface 2021-08-24 12:28:03 +02:00
run_test.go Network interface 2021-08-24 12:28:03 +02:00

This package abstracts CNI from libpod. It implements the ContainerNetwork interface defined in libpod/network/types/network.go for the CNI backend.

Testing

Run the tests with:

go test -v -mod=vendor -cover ./libpod/network/cni/

Run the tests as root to also test setup/teardown. This will execute CNI and therefore the cni plugins have to be installed.