summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-20 07:16:35 -0400
committerGitHub <noreply@github.com>2022-05-20 07:16:35 -0400
commit916d8231c52eb89fae9982c63a956388fca648c2 (patch)
tree335652b32332e57e092a1bbf80914517190f136e /pkg/api/handlers/compat/containers.go
parent1916fe22a932183e0847e9f7b087f6ece4d7c48c (diff)
parent5b79cf15a0226dc3dad5053615ee652823376cd3 (diff)
downloadpodman-916d8231c52eb89fae9982c63a956388fca648c2.tar.gz
podman-916d8231c52eb89fae9982c63a956388fca648c2.tar.bz2
podman-916d8231c52eb89fae9982c63a956388fca648c2.zip
Merge pull request #14297 from jwhonce/wip/swagger
Swagger refactor/cleanup
Diffstat (limited to 'pkg/api/handlers/compat/containers.go')
-rw-r--r--pkg/api/handlers/compat/containers.go42
1 files changed, 22 insertions, 20 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index e3d51fadf..616f0a138 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -369,26 +369,28 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
return nil, err
}
- return &handlers.Container{Container: types.Container{
- ID: l.ID(),
- Names: []string{fmt.Sprintf("/%s", l.Name())},
- Image: imageName,
- ImageID: "sha256:" + imageID,
- Command: strings.Join(l.Command(), " "),
- Created: l.CreatedTime().Unix(),
- Ports: ports,
- SizeRw: sizeRW,
- SizeRootFs: sizeRootFs,
- Labels: l.Labels(),
- State: stateStr,
- Status: status,
- HostConfig: struct {
- NetworkMode string `json:",omitempty"`
- }{
- "host"},
- NetworkSettings: &networkSettings,
- Mounts: mounts,
- },
+ return &handlers.Container{
+ Container: types.Container{
+ ID: l.ID(),
+ Names: []string{fmt.Sprintf("/%s", l.Name())},
+ Image: imageName,
+ ImageID: "sha256:" + imageID,
+ Command: strings.Join(l.Command(), " "),
+ Created: l.CreatedTime().Unix(),
+ Ports: ports,
+ SizeRw: sizeRW,
+ SizeRootFs: sizeRootFs,
+ Labels: l.Labels(),
+ State: stateStr,
+ Status: status,
+ HostConfig: struct {
+ NetworkMode string `json:",omitempty"`
+ }{
+ "host",
+ },
+ NetworkSettings: &networkSettings,
+ Mounts: mounts,
+ },
ContainerCreateConfig: types.ContainerCreateConfig{},
}, nil
}