Merge pull request #4696 from avagin/criu-vs-exec

criu: Add time namespace to container config after checkpoint/restore
This commit is contained in:
Rodrigo Campos
2025-04-01 14:54:33 -03:00
committed by GitHub
2 changed files with 42 additions and 0 deletions

View File

@@ -1151,6 +1151,13 @@ func (c *Container) criuNotifications(resp *criurpc.CriuResp, process *Process,
}
// create a timestamp indicating when the restored checkpoint was started
c.created = time.Now().UTC()
if !c.config.Namespaces.Contains(configs.NEWTIME) &&
configs.IsNamespaceSupported(configs.NEWTIME) &&
c.checkCriuVersion(31400) == nil {
// CRIU restores processes into a time namespace.
c.config.Namespaces = append(c.config.Namespaces,
configs.Namespace{Type: configs.NEWTIME})
}
if _, err := c.updateState(r); err != nil {
return err
}