Fix returning errors from snapshotter.Prepare

In the case of an error when calling snapshotter.Prepare we would return
nil. This change fixes that and returns the error from Prepare all the
time.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
Djordje Lukic 2023-04-14 10:10:52 +02:00
parent d69f9fe266
commit bc37e3f830
No known key found for this signature in database

View file

@ -51,9 +51,6 @@ func (i *ImageService) PrepareSnapshot(ctx context.Context, id string, parentIma
}
s := i.client.SnapshotService(i.StorageDriver())
if _, err := s.Prepare(ctx, id, parent); err == nil {
return err
}
return nil
_, err = s.Prepare(ctx, id, parent)
return err
}