MCPcopy
hub / github.com/containerd/containerd / WithCheckpointRuntime

Function WithCheckpointRuntime

client/container_checkpoint_opts.go:97–116  ·  view source on GitHub ↗

WithCheckpointRuntime includes the container runtime info

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

Source from the content-addressed store, hash-verified

95
96// WithCheckpointRuntime includes the container runtime info
97func WithCheckpointRuntime(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
98 if c.Runtime.Options != nil && c.Runtime.Options.GetValue() != nil {
99 opt := typeurl.MarshalProto(c.Runtime.Options)
100 data, err := proto.Marshal(opt)
101 if err != nil {
102 return err
103 }
104 r := bytes.NewReader(data)
105 desc, err := writeContent(ctx, client.ContentStore(), images.MediaTypeContainerd1CheckpointRuntimeOptions, c.ID+"-runtime-options", r)
106 if err != nil {
107 return err
108 }
109 desc.Platform = &imagespec.Platform{
110 OS: runtime.GOOS,
111 Architecture: runtime.GOARCH,
112 }
113 index.Manifests = append(index.Manifests, desc)
114 }
115 return nil
116}
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 {

Callers

nothing calls this directly

Calls 4

MarshalFunction · 0.92
writeContentFunction · 0.85
GetValueMethod · 0.80
ContentStoreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…