diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-10-04 16:00:43 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-10-04 16:38:52 +0200 |
commit | a726043d0b5c4ff9e59b01f2a48c575d53d67ed0 (patch) | |
tree | 2dfdc0fce30728f025ebaa0d8533af036c188fcb /test/apiv2/35-networks.at | |
parent | 36821d302e3787a42d6eefdbd0bdbb6d9da261fb (diff) | |
download | podman-a726043d0b5c4ff9e59b01f2a48c575d53d67ed0.tar.gz podman-a726043d0b5c4ff9e59b01f2a48c575d53d67ed0.tar.bz2 podman-a726043d0b5c4ff9e59b01f2a48c575d53d67ed0.zip |
CNI networks: reload networks if needed
The current implementation of the CNI network interface only loads the
networks on the first call and saves them in a map. This is done to safe
performance and not having to reload all configs every time which will be
costly for many networks.
The problem with this approach is that if a network is created by
another process it will not be picked up by the already running podman
process. This is not a problem for the short lived podman commands but
it is problematic for the podman service.
To make sure we always have the actual networks store the mtime of the
config directory. If it changed since the last read we have to read
again.
Fixes #11828
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/apiv2/35-networks.at')
-rw-r--r-- | test/apiv2/35-networks.at | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at index a4cb5a480..fd8dfd32b 100644 --- a/test/apiv2/35-networks.at +++ b/test/apiv2/35-networks.at @@ -131,8 +131,8 @@ t DELETE libpod/networks/network2 200 \ .[0].Err=null # test until filter - libpod api -t POST libpod/networks/create name='"network5"' labels='{"xyz":""}' 200 \ - .name=network5 +# create network via cli to test that the server can use it +podman network create --label xyz network5 # with date way back in the past, network should not be deleted t POST libpod/networks/prune?filters='{"until":["500000"]}' 200 |