From 6ce70a33c5825c0f4d2afae7643db95e8b7d46f1 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 20 Feb 2018 10:57:37 -0600 Subject: 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 Closes: #371 Approved by: baude --- test/e2e/commit_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/e2e/commit_test.go') diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index c807b46c5..154a83bd2 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -40,7 +40,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"inspect", "foobar.com/test1-image:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(StringInSlice("foobar.com/test1-image:latest", data.RepoTags)).To(BeTrue()) + Expect(StringInSlice("foobar.com/test1-image:latest", data[0].RepoTags)).To(BeTrue()) }) It("podman commit container with message", func() { @@ -55,7 +55,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"inspect", "foobar.com/test1-image:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(data.Comment).To(Equal("testing-commit")) + Expect(data[0].Comment).To(Equal("testing-commit")) }) It("podman commit container with author", func() { @@ -70,7 +70,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"inspect", "foobar.com/test1-image:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(data.Author).To(Equal("snoopy")) + Expect(data[0].Author).To(Equal("snoopy")) }) It("podman commit container with change flag", func() { @@ -88,7 +88,7 @@ var _ = Describe("Podman commit", func() { check.WaitWithDefaultTimeout() data := check.InspectImageJSON() foundBlue := false - for _, i := range data.Labels { + for _, i := range data[0].Labels { if i == "blue" { foundBlue = true break -- cgit v1.2.3-54-g00ecf