summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-01-03 13:26:32 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-01-04 10:56:03 -0500
commit0c6ae3ab2681c06dbaba0bb5c002d7f2b339db61 (patch)
tree321319105616ba8d5f4441c8a4f870dc9f5ad0e8 /pkg/api
parentaaf90c5596fb2232d915fcd75d4d707d180c1b17 (diff)
downloadpodman-0c6ae3ab2681c06dbaba0bb5c002d7f2b339db61.tar.gz
podman-0c6ae3ab2681c06dbaba0bb5c002d7f2b339db61.tar.bz2
podman-0c6ae3ab2681c06dbaba0bb5c002d7f2b339db61.zip
Fix Container List API call to return mount info
We are hard coding mounts to return nil in compat API, since we have the data, we should return it. Fixes: https://github.com/containers/podman/issues/12734 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/containers.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 5a06722ec..ad341c3ab 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -356,6 +356,15 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
return nil, err
}
+ m, err := json.Marshal(inspect.Mounts)
+ if err != nil {
+ return nil, err
+ }
+ mounts := []types.MountPoint{}
+ if err := json.Unmarshal(m, &mounts); err != nil {
+ return nil, err
+ }
+
return &handlers.Container{Container: types.Container{
ID: l.ID(),
Names: []string{fmt.Sprintf("/%s", l.Name())},
@@ -374,7 +383,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
}{
"host"},
NetworkSettings: &networkSettings,
- Mounts: nil,
+ Mounts: mounts,
},
ContainerCreateConfig: types.ContainerCreateConfig{},
}, nil