mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 15:02:45 +00:00
kata-monitor: fix updating sandbox cache at startup
We now rely on fs events only to update the sandbox cache. This is not true anyway for sandboxes already present at kata-monitor startup: we just retrieve the list and add them in the cache only when we get their CRI metadata. If CRI metadata is not available we will never add them to the sandbox cache. Fix this by immediately adding the sandboxes we find at startup time to the sandbox cache. Fixes: #3705 Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
This commit is contained in:
parent
160bb62138
commit
3ac52e8193
@ -104,6 +104,10 @@ func (km *KataMonitor) startPodCacheUpdater() {
|
||||
monitorLog.WithError(err).Fatal("cannot read sandboxes fs")
|
||||
os.Exit(1)
|
||||
}
|
||||
for _, sandbox := range sandboxList {
|
||||
km.sandboxCache.putIfNotExists(sandbox, sandboxKubeData{})
|
||||
}
|
||||
|
||||
monitorLog.Debug("initial sync of sbs directory completed")
|
||||
monitorLog.Tracef("pod list from sbs: %v", sandboxList)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user