mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-03 01:46:12 +00:00
Add mutex lock for load confs in GetDefaultNetworks (#1073)
Thick server's chroot mutex is missing in GetDefaultNetworks, that touch the pod filesystem. This change adds mutex lock there and prevent race condition. Fix #1072
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/containernetworking/cni/libcni"
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
@@ -39,6 +40,9 @@ const (
|
||||
defaultNonIsolatedNamespace = "default"
|
||||
)
|
||||
|
||||
// ChrootMutex provides lock to access host filesystem
|
||||
var ChrootMutex *sync.Mutex
|
||||
|
||||
// LoadDelegateNetConfList reads DelegateNetConf from bytes
|
||||
func LoadDelegateNetConfList(bytes []byte, delegateConf *DelegateNetConf) error {
|
||||
logging.Debugf("LoadDelegateNetConfList: %s, %v", string(bytes), delegateConf)
|
||||
|
Reference in New Issue
Block a user