
This connects the new CRI ContainerCheckpoint RPC to the existing internal checkpoint functions. With this commit it is possible to checkpoint a container in Kubernetes using the Forensic Container Checkpointing KEP (#2008): # curl X POST "https://localhost:10250/checkpoint/namespace/podId/container" Which will result in containerd creating a checkpoint in the location specified by Kubernetes (usually /var/lib/kubelet/checkpoints). This is a Linux only feature because CRIU only exists on Linux. Rewritten with the help of Phil Estes. Signed-off-by: Phil Estes <estesp@gmail.com> Signed-off-by: Adrian Reber <areber@redhat.com>
63 lines
1.0 KiB
Go
63 lines
1.0 KiB
Go
package criu
|
|
|
|
// Notify interface
|
|
type Notify interface {
|
|
PreDump() error
|
|
PostDump() error
|
|
PreRestore() error
|
|
PostRestore(pid int32) error
|
|
NetworkLock() error
|
|
NetworkUnlock() error
|
|
SetupNamespaces(pid int32) error
|
|
PostSetupNamespaces() error
|
|
PostResume() error
|
|
}
|
|
|
|
// NoNotify struct
|
|
type NoNotify struct{}
|
|
|
|
// PreDump NoNotify
|
|
func (c NoNotify) PreDump() error {
|
|
return nil
|
|
}
|
|
|
|
// PostDump NoNotify
|
|
func (c NoNotify) PostDump() error {
|
|
return nil
|
|
}
|
|
|
|
// PreRestore NoNotify
|
|
func (c NoNotify) PreRestore() error {
|
|
return nil
|
|
}
|
|
|
|
// PostRestore NoNotify
|
|
func (c NoNotify) PostRestore(pid int32) error {
|
|
return nil
|
|
}
|
|
|
|
// NetworkLock NoNotify
|
|
func (c NoNotify) NetworkLock() error {
|
|
return nil
|
|
}
|
|
|
|
// NetworkUnlock NoNotify
|
|
func (c NoNotify) NetworkUnlock() error {
|
|
return nil
|
|
}
|
|
|
|
// SetupNamespaces NoNotify
|
|
func (c NoNotify) SetupNamespaces(pid int32) error {
|
|
return nil
|
|
}
|
|
|
|
// PostSetupNamespaces NoNotify
|
|
func (c NoNotify) PostSetupNamespaces() error {
|
|
return nil
|
|
}
|
|
|
|
// PostResume NoNotify
|
|
func (c NoNotify) PostResume() error {
|
|
return nil
|
|
}
|