| 92 | } |
| 93 | |
| 94 | func (p *proxySnapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
| 95 | var local snapshots.Info |
| 96 | for _, opt := range opts { |
| 97 | if err := opt(&local); err != nil { |
| 98 | return nil, err |
| 99 | } |
| 100 | } |
| 101 | resp, err := p.client.Prepare(ctx, &snapshotsapi.PrepareSnapshotRequest{ |
| 102 | Snapshotter: p.snapshotterName, |
| 103 | Key: key, |
| 104 | Parent: parent, |
| 105 | Labels: local.Labels, |
| 106 | }) |
| 107 | if err != nil { |
| 108 | return nil, errgrpc.ToNative(err) |
| 109 | } |
| 110 | return mount.FromProto(resp.Mounts), nil |
| 111 | } |
| 112 | |
| 113 | func (p *proxySnapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
| 114 | var local snapshots.Info |