diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-09-07 18:31:23 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-09-08 10:28:42 +0200 |
commit | d10e77e1bcd25306ab8afd4ce7da16eed3c67840 (patch) | |
tree | d0f95b1fee3f30b89f5e4d4eb4a9d21a49738b48 /cmd/podman/common | |
parent | e46bcd72f8d6528dbafb1ad1b34abeb0177a8b77 (diff) | |
download | podman-d10e77e1bcd25306ab8afd4ce7da16eed3c67840.tar.gz podman-d10e77e1bcd25306ab8afd4ce7da16eed3c67840.tar.bz2 podman-d10e77e1bcd25306ab8afd4ce7da16eed3c67840.zip |
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 <pholzing@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-rw-r--r-- | cmd/podman/common/inspect.go | 4 |
1 files changed, 4 insertions, 0 deletions
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" ) |