WithCheckpointRW includes the rw in the checkpoint
(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions)
| 117 | |
| 118 | // WithCheckpointRW includes the rw in the checkpoint |
| 119 | func WithCheckpointRW(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { |
| 120 | diffOpts := []diff.Opt{ |
| 121 | diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", c.SnapshotKey)), |
| 122 | } |
| 123 | rw, err := rootfs.CreateDiff(ctx, |
| 124 | c.SnapshotKey, |
| 125 | client.SnapshotService(c.Snapshotter), |
| 126 | client.DiffService(), |
| 127 | diffOpts..., |
| 128 | ) |
| 129 | if err != nil { |
| 130 | return err |
| 131 | |
| 132 | } |
| 133 | rw.Platform = &imagespec.Platform{ |
| 134 | OS: runtime.GOOS, |
| 135 | Architecture: runtime.GOARCH, |
| 136 | } |
| 137 | index.Manifests = append(index.Manifests, rw) |
| 138 | return nil |
| 139 | } |
| 140 | |
| 141 | // WithCheckpointTaskExit causes the task to exit after checkpoint |
| 142 | func WithCheckpointTaskExit(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error { |
nothing calls this directly
no test coverage detected
searching dependent graphs…