From 043308198337941a8086113619d6341528c10cd0 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 31 Mar 2020 14:45:19 -0500 Subject: podmanv2 import add the ability to import a container image from a container export Signed-off-by: Brent Baude --- pkg/domain/infra/abi/images.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/domain/infra/abi/images.go') diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index c3a2bb288..f8c63730c 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -303,6 +303,7 @@ func (ir *ImageEngine) Tag(ctx context.Context, nameOrId string, tags []string, } return nil } + func (ir *ImageEngine) Untag(ctx context.Context, nameOrId string, tags []string, options entities.ImageUntagOptions) error { newImage, err := ir.Libpod.ImageRuntime().NewFromLocal(nameOrId) if err != nil { @@ -336,3 +337,11 @@ func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions) } return &entities.ImageLoadReport{Name: name}, nil } + +func (ir *ImageEngine) Import(ctx context.Context, opts entities.ImageImportOptions) (*entities.ImageImportReport, error) { + id, err := ir.Libpod.Import(ctx, opts.Source, opts.Reference, opts.Changes, opts.Message, opts.Quiet) + if err != nil { + return nil, err + } + return &entities.ImageImportReport{Id: id}, nil +} -- cgit v1.2.3-54-g00ecf