diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-02 14:40:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 14:40:48 +0100 |
commit | b41026aec77fc7b74a45560f242be66c25af59a6 (patch) | |
tree | cd76cce7bfd771a86d0408ade8047b9d3c0c9abc /pkg/domain/infra/abi | |
parent | 6b5ecde76ebb177b1ab1dd9e9555fc198ad90858 (diff) | |
parent | 3ff47748dea946775b8f4ec8e1c644c2efb3950b (diff) | |
download | podman-b41026aec77fc7b74a45560f242be66c25af59a6.tar.gz podman-b41026aec77fc7b74a45560f242be66c25af59a6.tar.bz2 podman-b41026aec77fc7b74a45560f242be66c25af59a6.zip |
Merge pull request #12469 from Luap99/ns-teardown-flake
Fix possible rootless netns cleanup race
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/system.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 7da7754f2..e6c9d850b 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -365,9 +365,12 @@ func (ic *ContainerEngine) Unshare(ctx context.Context, args []string, options e if err != nil { return err } - // make sure to unlock, unshare can run for a long time + // Make sure to unlock, unshare can run for a long time. rootlessNetNS.Lock.Unlock() - defer rootlessNetNS.Cleanup(ic.Libpod) + // We do not want to cleanup the netns after unshare. + // The problem is that we cannot know if we need to cleanup and + // secondly unshare should allow user to setup the namespace with + // special things, e.g. potentially macvlan or something like that. return rootlessNetNS.Do(unshare) } return unshare() |