WithRestoreRW restores the rw layer from the checkpoint for the container
(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index)
| 131 | |
| 132 | // WithRestoreRW restores the rw layer from the checkpoint for the container |
| 133 | func WithRestoreRW(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts { |
| 134 | return func(ctx context.Context, client *Client, c *containers.Container) error { |
| 135 | // apply rw layer |
| 136 | rw, err := GetIndexByMediaType(index, imagespec.MediaTypeImageLayerGzip) |
| 137 | if err != nil { |
| 138 | return err |
| 139 | } |
| 140 | mounts, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, c.SnapshotKey) |
| 141 | if err != nil { |
| 142 | return err |
| 143 | } |
| 144 | |
| 145 | if _, err := client.DiffService().Apply(ctx, *rw, mounts); err != nil { |
| 146 | return err |
| 147 | } |
| 148 | return nil |
| 149 | } |
| 150 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…