WithCheckpointRuntime includes the container runtime info
(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions)
| 95 | |
| 96 | // WithCheckpointRuntime includes the container runtime info |
| 97 | func 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 |
| 119 | func WithCheckpointRW(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…