summaryrefslogtreecommitdiff
path: root/libpod/network/network.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-01-20 22:56:13 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-01-21 11:50:45 +0100
commit836fa4c493c3809da4bbcbbec0bf5ceb954e7410 (patch)
treea07df59ab8a8ca5ef913c69c977662d0cbb441aa /libpod/network/network.go
parentc1cd512cb824c4c470efe7660c91ffeda62327bc (diff)
downloadpodman-836fa4c493c3809da4bbcbbec0bf5ceb954e7410.tar.gz
podman-836fa4c493c3809da4bbcbbec0bf5ceb954e7410.tar.bz2
podman-836fa4c493c3809da4bbcbbec0bf5ceb954e7410.zip
Move the cni lock file into the cni config dir
Commit(fe3faa517e1b) introduced a lock file for network create/rm calls. There is a problem with the location of the lock file. The lock file was stored in the tmpdir. Running multiple podman network create/remove commands in parallel with different tmpdirs made the lockfile inaccessible to the other process, and so parallel read/write operations to the cni config directory continued to occur. This scenario happened frequently during the e2e tests and caused some flakes. Fixes #9041 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'libpod/network/network.go')
-rw-r--r--libpod/network/network.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/network/network.go b/libpod/network/network.go
index 89f0b67ac..0fb878b18 100644
--- a/libpod/network/network.go
+++ b/libpod/network/network.go
@@ -6,7 +6,6 @@ import (
"encoding/json"
"net"
"os"
- "path/filepath"
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/plugins/plugins/ipam/host-local/backend/allocator"
@@ -172,7 +171,7 @@ func ValidateUserNetworkIsAvailable(config *config.Config, userNet *net.IPNet) e
// RemoveNetwork removes a given network by name. If the network has container associated with it, that
// must be handled outside the context of this.
func RemoveNetwork(config *config.Config, name string) error {
- l, err := acquireCNILock(filepath.Join(config.Engine.TmpDir, LockFileName))
+ l, err := acquireCNILock(config)
if err != nil {
return err
}