Enable to propagate necessary information to snapshotter during unpack

Though containerd gives ChainID to backend snapshotters during unpack for
searching snapshots to be skipped downloading the contents, ChainID isn't enough
for some snapshotters which require additional information of layers.
Some examples are remote snapshotters which is based on stargz filesystem
(requires image-related information to query the contents to docker registry)
and those which is based on CernVM-FS (requires manifest digest, etc. for
providing squashed rootfs).

This commit solves this issue by enabling a handler to inject additional
information of layers to snapshotters during unpack.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga
2019-12-23 10:39:40 +09:00
parent 97712c8ad7
commit 4ccb7aa221
2 changed files with 17 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (_ Ima
if wrapper == nil {
return unpackWrapper(h)
}
return wrapper(unpackWrapper(h))
return unpackWrapper(wrapper(h))
}
}