MCPcopy Index your code
hub / github.com/containerd/containerd / WithCheckpointRW

Function WithCheckpointRW

client/container_checkpoint_opts.go:119–139  ·  view source on GitHub ↗

WithCheckpointRW includes the rw in the checkpoint

(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions)

Source from the content-addressed store, hash-verified

117
118// WithCheckpointRW includes the rw in the checkpoint
119func 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
142func WithCheckpointTaskExit(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {

Callers

nothing calls this directly

Calls 4

WithReferenceFunction · 0.92
CreateDiffFunction · 0.92
DiffServiceMethod · 0.80
SnapshotServiceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…