summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-10-04 16:00:11 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-10-15 12:16:47 +0200
commit019f19cf4fbc0e17cb46bb6c992147cd9eebb287 (patch)
tree38f3e85e824562233858389c75e0f09c80ce73db /libpod/container_inspect.go
parent25572cefa8f16580c4a61af86cf2c41281e0300f (diff)
downloadpodman-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 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 5a92b3e54..70b51960b 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -96,7 +96,7 @@ type InspectContainerData struct {
Path string `json:"Path"`
Args []string `json:"Args"`
State *InspectContainerState `json:"State"`
- ImageID string `json:"Image"`
+ Image string `json:"Image"`
ImageName string `json:"ImageName"`
Rootfs string `json:"Rootfs"`
Pod string `json:"Pod"`
@@ -718,7 +718,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *driver.Data)
StartedAt: runtimeInfo.StartedTime,
FinishedAt: runtimeInfo.FinishedTime,
},
- ImageID: config.RootfsImageID,
+ Image: config.RootfsImageID,
ImageName: config.RootfsImageName,
ExitCommand: config.ExitCommand,
Namespace: config.Namespace,