mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-03 18:06:11 +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:
@@ -136,10 +136,12 @@ func NewCNIServer(daemonConfig *ControllerNetConf, serverConfig []byte) (*Server
|
||||
|
||||
exec := invoke.Exec(nil)
|
||||
if daemonConfig.ChrootDir != "" {
|
||||
exec = &ChrootExec{
|
||||
chrootExec := &ChrootExec{
|
||||
Stderr: os.Stderr,
|
||||
chrootDir: daemonConfig.ChrootDir,
|
||||
}
|
||||
types.ChrootMutex = &chrootExec.mu
|
||||
exec = chrootExec
|
||||
logging.Verbosef("server configured with chroot: %s", daemonConfig.ChrootDir)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user