From d8d1aa49d27d51f914a0858ab99c57d7dc929926 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Mon, 13 Apr 2020 16:04:05 -0500 Subject: v2podman add container init add the ability to init a container both local and remote Signed-off-by: Brent Baude --- pkg/domain/infra/abi/containers.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pkg/domain/infra/abi/containers.go') diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 7f8ec210b..a3a0a8202 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -794,3 +794,17 @@ func (ic *ContainerEngine) ContainerCleanup(ctx context.Context, namesOrIds []st } return reports, nil } + +func (ic *ContainerEngine) ContainerInit(ctx context.Context, namesOrIds []string, options entities.ContainerInitOptions) ([]*entities.ContainerInitReport, error) { + var reports []*entities.ContainerInitReport + ctrs, err := getContainersByContext(options.All, options.Latest, namesOrIds, ic.Libpod) + if err != nil { + return nil, err + } + for _, ctr := range ctrs { + report := entities.ContainerInitReport{Id: ctr.ID()} + report.Err = ctr.Init(ctx) + reports = append(reports, &report) + } + return reports, nil +} -- cgit v1.2.3-54-g00ecf