From d10e77e1bcd25306ab8afd4ce7da16eed3c67840 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 7 Sep 2022 18:31:23 +0200 Subject: fix podman pod inspect to support multiple pods Just like the other inspect commands `podman pod inspect p1 p2` should return the json for both. To correctly implement this we follow the container inspect logic, this allows use to reuse the global inspect command. Note: To not break the existing single pod output format for podman pod inspect I added a pod-legacy inspect type. This is only used to make sure we will print the pod as single json and not an array like for the other commands. We cannot use the pod type since podman inspect --type pod did return an array and we should not break that as well. Fixes #15674 Signed-off-by: Paul Holzinger --- cmd/podman/common/inspect.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/podman/common') diff --git a/cmd/podman/common/inspect.go b/cmd/podman/common/inspect.go index 12a5af5a9..f82161d31 100644 --- a/cmd/podman/common/inspect.go +++ b/cmd/podman/common/inspect.go @@ -11,6 +11,10 @@ const ( NetworkType = "network" // PodType is the pod type. PodType = "pod" + // PodLegacyType is the pod type for backwards compatibility with the old pod inspect code. + // This allows us to use the shared inspect code but still provide the correct output format + // when podman pod inspect was called. + PodLegacyType = "pod-legacy" // VolumeType is the volume type VolumeType = "volume" ) -- cgit v1.2.3-54-g00ecf