mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
Vendor in latest containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/common/libnetwork/netavark/const.go
generated
vendored
2
vendor/github.com/containers/common/libnetwork/netavark/const.go
generated
vendored
@@ -4,3 +4,5 @@
|
||||
package netavark
|
||||
|
||||
const defaultBridgeName = "podman"
|
||||
|
||||
const defaultRootLockPath = "/run/lock/netavark.lock"
|
||||
|
||||
9
vendor/github.com/containers/common/libnetwork/netavark/network.go
generated
vendored
9
vendor/github.com/containers/common/libnetwork/netavark/network.go
generated
vendored
@@ -94,8 +94,13 @@ type InitConfig struct {
|
||||
// NewNetworkInterface creates the ContainerNetwork interface for the netavark backend.
|
||||
// Note: The networks are not loaded from disk until a method is called.
|
||||
func NewNetworkInterface(conf *InitConfig) (types.ContainerNetwork, error) {
|
||||
// TODO: consider using a shared memory lock
|
||||
lock, err := lockfile.GetLockFile(filepath.Join(conf.NetworkConfigDir, "netavark.lock"))
|
||||
// root needs to use a globally unique lock because there is only one host netns
|
||||
lockPath := defaultRootLockPath
|
||||
if unshare.IsRootless() {
|
||||
lockPath = filepath.Join(conf.NetworkConfigDir, "netavark.lock")
|
||||
}
|
||||
|
||||
lock, err := lockfile.GetLockFile(lockPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user