diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-13 16:04:05 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-13 19:51:20 -0500 |
commit | d8d1aa49d27d51f914a0858ab99c57d7dc929926 (patch) | |
tree | 715f035f049b161b55932fa9586f24c1876f11a5 /pkg/domain/infra/tunnel/containers.go | |
parent | 5cf64aee11063bc8e7ff22f1365b0bf6b3ab0900 (diff) | |
download | podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.tar.gz podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.tar.bz2 podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.zip |
v2podman add container init
add the ability to init a container both local and remote
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 2bc3a1914..1a430e3d0 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -338,3 +338,19 @@ func (ic *ContainerEngine) ContainerDiff(ctx context.Context, nameOrId string, _ func (ic *ContainerEngine) ContainerCleanup(ctx context.Context, namesOrIds []string, options entities.ContainerCleanupOptions) ([]*entities.ContainerCleanupReport, error) { return nil, errors.New("not implemented") } + +func (ic *ContainerEngine) ContainerInit(ctx context.Context, namesOrIds []string, options entities.ContainerInitOptions) ([]*entities.ContainerInitReport, error) { + var reports []*entities.ContainerInitReport + ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds) + if err != nil { + return nil, err + } + for _, ctr := range ctrs { + err := containers.ContainerInit(ic.ClientCxt, ctr.ID) + reports = append(reports, &entities.ContainerInitReport{ + Err: err, + Id: ctr.ID, + }) + } + return reports, nil +} |