Merge pull request #1848 from adrianreber/master

Add tcp-established to checkpoint/restore
This commit is contained in:
OpenShift Merge Robot
2018-11-28 07:00:24 -08:00
committed by GitHub
16 changed files with 245 additions and 36 deletions

View File

@ -833,10 +833,16 @@ func (c *Container) Refresh(ctx context.Context) error {
}
// ContainerCheckpointOptions is a struct used to pass the parameters
// for checkpointing to corresponding functions
// for checkpointing (and restoring) to the corresponding functions
type ContainerCheckpointOptions struct {
Keep bool
// Keep tells the API to not delete checkpoint artifacts
Keep bool
// KeepRunning tells the API to keep the container running
// after writing the checkpoint to disk
KeepRunning bool
// TCPEstablished tells the API to checkpoint a container
// even if it contains established TCP connections
TCPEstablished bool
}
// Checkpoint checkpoints a container
@ -855,7 +861,7 @@ func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointO
}
// Restore restores a container
func (c *Container) Restore(ctx context.Context, keep bool) (err error) {
func (c *Container) Restore(ctx context.Context, options ContainerCheckpointOptions) (err error) {
logrus.Debugf("Trying to restore container %s", c)
if !c.batched {
c.lock.Lock()
@ -866,5 +872,5 @@ func (c *Container) Restore(ctx context.Context, keep bool) (err error) {
}
}
return c.restore(ctx, keep)
return c.restore(ctx, options)
}