cri,nri: block NRI plugin sync. during event processing.
Block the synchronization of registering NRI plugins during CRI events to avoid the plugin ending up in an inconsistent starting state after initial sync (missing pods, containers or missed events for some pods or containers). Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
This commit is contained in:
@@ -358,6 +358,15 @@ func (a *API) WithContainerExit(criCtr *cstore.Container) containerd.ProcessDele
|
||||
}
|
||||
}
|
||||
|
||||
type PluginSyncBlock = nri.PluginSyncBlock
|
||||
|
||||
func (a *API) BlockPluginSync() *PluginSyncBlock {
|
||||
if a.IsDisabled() {
|
||||
return nil
|
||||
}
|
||||
return a.nri.BlockPluginSync()
|
||||
}
|
||||
|
||||
//
|
||||
// NRI-CRI 'domain' interface
|
||||
//
|
||||
|
||||
@@ -108,6 +108,14 @@ func (*API) WithContainerExit(*cstore.Container) containerd.ProcessDeleteOpts {
|
||||
}
|
||||
}
|
||||
|
||||
type PluginSyncBlock struct{}
|
||||
|
||||
func (*API) BlockPluginSync() *PluginSyncBlock {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*PluginSyncBlock) Unblock() {}
|
||||
|
||||
//
|
||||
// NRI-CRI no-op 'domain' interface
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user