remotecache: allow uncompressed digest in inline export

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-19.03
Tonis Tiigi 2019-03-13 16:01:42 -07:00
parent f3b968c91a
commit d9cdaf8003
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,13 @@ func (ce *exporter) ExportForLayers(layers []digest.Digest) ([]byte, error) {
for _, k := range layers { for _, k := range layers {
if v, ok := descs[k]; ok { if v, ok := descs[k]; ok {
descs2[k] = v descs2[k] = v
continue
}
// fallback for uncompressed digests
for _, v := range descs {
if uc := v.Descriptor.Annotations["containerd.io/uncompressed"]; uc == string(k) {
descs2[v.Descriptor.Digest] = v
}
} }
} }