diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2019-10-04 16:00:11 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2019-10-15 12:16:47 +0200 |
commit | 019f19cf4fbc0e17cb46bb6c992147cd9eebb287 (patch) | |
tree | 38f3e85e824562233858389c75e0f09c80ce73db /test/e2e | |
parent | 25572cefa8f16580c4a61af86cf2c41281e0300f (diff) | |
download | podman-019f19cf4fbc0e17cb46bb6c992147cd9eebb287.tar.gz podman-019f19cf4fbc0e17cb46bb6c992147cd9eebb287.tar.bz2 podman-019f19cf4fbc0e17cb46bb6c992147cd9eebb287.zip |
inspect: rename ImageID go field to Image
The json field is called `Image` while the go field is called `ImageID`,
tricking users into filtering for `Image` which ultimately results in an
error. Hence, rename the field to `Image` to align json and go.
To prevent podman users from regressing, rename `Image` to `ImageID` in
the specified filters. Add tests to prevent us from regressing. Note
that consumers of the go API that are using `ImageID` are regressing;
ultimately we consider it to be a bug fix.
Fixes: #4193
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/inspect_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go index 790115133..ca1e9d384 100644 --- a/test/e2e/inspect_test.go +++ b/test/e2e/inspect_test.go @@ -100,6 +100,23 @@ var _ = Describe("Podman inspect", func() { Expect(len(result.OutputToStringArray())).To(Equal(2)) }) + It("podman inspect container and filter for Image{ID}", func() { + SkipIfRemote() + ls, ec, _ := podmanTest.RunLsContainer("") + Expect(ec).To(Equal(0)) + cid := ls.OutputToString() + + result := podmanTest.Podman([]string{"inspect", "--format={{.ImageID}}", cid}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + Expect(len(result.OutputToStringArray())).To(Equal(1)) + + result = podmanTest.Podman([]string{"inspect", "--format={{.Image}}", cid}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + Expect(len(result.OutputToStringArray())).To(Equal(1)) + }) + It("podman inspect -l with additional input should fail", func() { SkipIfRemote() result := podmanTest.Podman([]string{"inspect", "-l", "1234foobar"}) |