summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel/containers.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-26 13:37:09 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-26 15:54:26 -0500
commit2fa78938a94e90e41755b68dd1af36f5b817ed55 (patch)
treef6a1161387751d8a413c0ebe66ba253f4a91a1af /pkg/domain/infra/tunnel/containers.go
parent6a46a87d08bd1e9ddda3dd3c9c30d21d2226a654 (diff)
downloadpodman-2fa78938a94e90e41755b68dd1af36f5b817ed55.tar.gz
podman-2fa78938a94e90e41755b68dd1af36f5b817ed55.tar.bz2
podman-2fa78938a94e90e41755b68dd1af36f5b817ed55.zip
podmanv2 container inspect
add ability to inspect a container 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.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index a8ecff41b..367ea6e36 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -138,3 +138,21 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
}
return reports, nil
}
+
+func (ic *ContainerEngine) ContainerInspect(ctx context.Context, namesOrIds []string, options entities.ContainerInspectOptions) ([]*entities.ContainerInspectReport, error) {
+ var (
+ reports []*entities.ContainerInspectReport
+ )
+ ctrs, err := getContainersByContext(ic.ClientCxt, false, namesOrIds)
+ if err != nil {
+ return nil, err
+ }
+ for _, con := range ctrs {
+ data, err := containers.Inspect(ic.ClientCxt, con.ID, &options.Size)
+ if err != nil {
+ return nil, err
+ }
+ reports = append(reports, &entities.ContainerInspectReport{InspectContainerData: data})
+ }
+ return reports, nil
+}