Missing layers in tar will not cause an error if 
layers are already loaded before.

Fixes #18723

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2015-12-16 13:46:40 -08:00
Родитель 2180dd6cf0
Коммит f946782316
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -73,9 +73,14 @@ func (l *tarexporter) Load(inTar io.ReadCloser, outStream io.Writer) error {
if err != nil {
return err
}
newLayer, err := l.loadLayer(layerPath, rootFS)
r := rootFS
r.Append(diffID)
newLayer, err := l.ls.Get(r.ChainID())
if err != nil {
return err
newLayer, err = l.loadLayer(layerPath, rootFS)
if err != nil {
return err
}
}
defer layer.ReleaseAndLog(l.ls, newLayer)
if expected, actual := diffID, newLayer.DiffID(); expected != actual {