From f82abc774a70419bc7a2ff444a323110e1d9d938 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 26 Aug 2020 18:07:51 +0900 Subject: rootless: support `podman network create` (CNI-in-slirp4netns) Usage: ``` $ podman network create foo $ podman run -d --name web --hostname web --network foo nginx:alpine $ podman run --rm --network foo alpine wget -O - http://web.dns.podman Connecting to web.dns.podman (10.88.4.6:80) ...

Welcome to nginx!

... ``` See contrib/rootless-cni-infra for the design. Signed-off-by: Akihiro Suda --- libpod/runtime_ctr.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libpod/runtime_ctr.go') diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index fa91fe002..6c29e0577 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -770,7 +770,11 @@ func (r *Runtime) LookupContainer(idOrName string) (*Container, error) { func (r *Runtime) GetContainers(filters ...ContainerFilter) ([]*Container, error) { r.lock.RLock() defer r.lock.RUnlock() + return r.GetContainersWithoutLock(filters...) +} +// GetContainersWithoutLock is same as GetContainers but without lock +func (r *Runtime) GetContainersWithoutLock(filters ...ContainerFilter) ([]*Container, error) { if !r.valid { return nil, define.ErrRuntimeStopped } -- cgit v1.2.3-54-g00ecf