summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-18 15:24:02 +0100
committerGitHub <noreply@github.com>2020-02-18 15:24:02 +0100
commitbc20cb9281434a95685bd95de0430a7c40b606e4 (patch)
tree6e2249acef7e470fbf717f279e665de412beb4d6 /pkg/api/handlers
parent0bd29f89e9d26c9012c76e58050e1bdfd90faaf0 (diff)
parentc0c44ae8a36121dc13f7984cf8b3347c21f43f51 (diff)
downloadpodman-bc20cb9281434a95685bd95de0430a7c40b606e4.tar.gz
podman-bc20cb9281434a95685bd95de0430a7c40b606e4.tar.bz2
podman-bc20cb9281434a95685bd95de0430a7c40b606e4.zip
Merge pull request #5158 from jwhonce/issues/5151
Fix handler and systemd activation errors
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/types.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index f5d9f9ad5..a50f183f7 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -351,18 +351,21 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI
func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Container, error) {
imageId, imageName := l.Image()
- sizeRW, err := l.RWSize()
- if err != nil {
+
+ var (
+ err error
+ sizeRootFs int64
+ sizeRW int64
+ state define.ContainerStatus
+ )
+
+ if state, err = l.State(); err != nil {
return nil, err
}
-
- SizeRootFs, err := l.RootFsSize()
- if err != nil {
+ if sizeRW, err = l.RWSize(); err != nil {
return nil, err
}
-
- state, err := l.State()
- if err != nil {
+ if sizeRootFs, err = l.RootFsSize(); err != nil {
return nil, err
}
@@ -375,7 +378,7 @@ func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Contai
Created: l.CreatedTime().Unix(),
Ports: nil,
SizeRw: sizeRW,
- SizeRootFs: SizeRootFs,
+ SizeRootFs: sizeRootFs,
Labels: l.Labels(),
State: string(state),
Status: "",