From 4e0656f62e6c27a54e65243c092210460e77c6cb Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Tue, 7 Mar 2023 15:28:25 -0800 Subject: [PATCH] Import base layer images If a project creates a base layer image and wants to directly import the base then this ensure the baseline file are in place. It is a follow up to #1637 and enables containerd with ctr image import image.tar of a base layer. Signed-off-by: James Sturtevant --- internal/wclayer/importlayer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/wclayer/importlayer.go b/internal/wclayer/importlayer.go index 50f669a261..1bdb3042b2 100644 --- a/internal/wclayer/importlayer.go +++ b/internal/wclayer/importlayer.go @@ -142,6 +142,12 @@ func NewLayerWriter(ctx context.Context, path string, parentLayerPaths []string) if err != nil { return nil, err } + + // ensure the required files are present in the base layer + _, err = ensureBaseLayer(f) + if err != nil { + return nil, err + } return &baseLayerWriter{ ctx: ctx, s: span,