Add support for partial load
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:
parent
2180dd6cf0
commit
f946782316
1 changed files with 7 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue