diff options
author | baude <bbaude@redhat.com> | 2018-02-20 10:57:37 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-21 14:22:36 +0000 |
commit | 6ce70a33c5825c0f4d2afae7643db95e8b7d46f1 (patch) | |
tree | 5d387d97c7cac2a0ca8b9c8a8c0ceed2a8c472ff /test/e2e/libpod_suite_test.go | |
parent | e929e7de4cf537c5de5817b7c086bc4883a8b93a (diff) | |
download | podman-6ce70a33c5825c0f4d2afae7643db95e8b7d46f1.tar.gz podman-6ce70a33c5825c0f4d2afae7643db95e8b7d46f1.tar.bz2 podman-6ce70a33c5825c0f4d2afae7643db95e8b7d46f1.zip |
Inspect output should be in array form
Inspect should be able to inspect one or more containers depending
on the user input. Therefore, inspect output should be in array
format so the consumer could potentially iterate it. This PR allows
users to specify one more or containers|images|or a mix for
inspection. The output, as stated, is therefore in array form. This
holds true even for a singular image.
In the case that the user enters an invalid container|image "name", we
handle that gracefully. Podman will output json for the valid names
until it reaches the invalid one. For example:
In this case, podman will out the json for alpine and then print an
error about 123 being invalid. It will not continute onto busybox.
This behavior imatates docker.
This addresses issue #360
Signed-off-by: baude <bbaude@redhat.com>
Closes: #371
Approved by: baude
Diffstat (limited to 'test/e2e/libpod_suite_test.go')
-rw-r--r-- | test/e2e/libpod_suite_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index c479a6cef..bd117d5f4 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -228,8 +228,8 @@ func (s *PodmanSession) IsJSONOutputValid() bool { // InspectContainerToJSON takes the session output of an inspect // container and returns json -func (s *PodmanSession) InspectContainerToJSON() inspect.ContainerData { - var i inspect.ContainerData +func (s *PodmanSession) InspectContainerToJSON() []inspect.ContainerData { + var i []inspect.ContainerData err := json.Unmarshal(s.Out.Contents(), &i) Expect(err).To(BeNil()) return i @@ -237,8 +237,8 @@ func (s *PodmanSession) InspectContainerToJSON() inspect.ContainerData { // InspectImageJSON takes the session output of an inspect // image and returns json -func (s *PodmanSession) InspectImageJSON() inspect.ImageData { - var i inspect.ImageData +func (s *PodmanSession) InspectImageJSON() []inspect.ImageData { + var i []inspect.ImageData err := json.Unmarshal(s.Out.Contents(), &i) Expect(err).To(BeNil()) return i |