Don't call setupInit in a temp mount if setupInit is nil
This is consistent with layerStore's CreateRWLayer behaviour. Potentially this can be refactored to avoid creating the -init layer, but as noted in layerStore's initMount, this name may be special, and should be cleared-out all-at-once. Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com> Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
efadb70ef8
commit
a1f6b64e24
1 changed files with 6 additions and 4 deletions
|
@ -87,10 +87,12 @@ func (i *ImageService) prepareInitLayer(ctx context.Context, id string, parent s
|
|||
return err
|
||||
}
|
||||
|
||||
if err := mount.WithTempMount(ctx, mounts, func(root string) error {
|
||||
return setupInit(root)
|
||||
}); err != nil {
|
||||
return err
|
||||
if setupInit != nil {
|
||||
if err := mount.WithTempMount(ctx, mounts, func(root string) error {
|
||||
return setupInit(root)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return snapshotter.Commit(ctx, id+"-init", id+"-init-key")
|
||||
|
|
Loading…
Add table
Reference in a new issue