summaryrefslogtreecommitdiff
path: root/libpod/container_inspect.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2019-06-21 15:09:59 -0400
committerMatthew Heon <mheon@redhat.com>2019-06-21 15:09:59 -0400
commit7d76548b419a080acd53ab410a416767ca26409d (patch)
treeacd676313e4e6cc64aa8c478d8d1cd440a2c6695 /libpod/container_inspect.go
parent778a634daa4c24065af8fddf803be01a0de77b73 (diff)
downloadpodman-7d76548b419a080acd53ab410a416767ca26409d.tar.gz
podman-7d76548b419a080acd53ab410a416767ca26409d.tar.bz2
podman-7d76548b419a080acd53ab410a416767ca26409d.zip
Adjust names to match struct tags in Inspect
In Go templating, we use the names of fields, not the JSON struct tags. To ensure templating works are expected, we need the two to match. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/container_inspect.go')
-rw-r--r--libpod/container_inspect.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 3f4de5b5a..0d95443a1 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -111,10 +111,10 @@ type InspectMount struct {
// The name of the volume. Empty for bind mounts.
Name string `json:"Name,omptempty"`
// The source directory for the volume.
- Src string `json:"Source"`
+ Source string `json:"Source"`
// The destination directory for the volume. Specified as a path within
// the container, as it would be passed into the OCI runtime.
- Dst string `json:"Destination"`
+ Destination string `json:"Destination"`
// The driver used for the named volume. Empty for bind mounts.
Driver string `json:"Driver"`
// Contains SELinux :z/:Z mount options. Unclear what, if anything, else
@@ -386,7 +386,7 @@ func (c *Container) getInspectMounts(ctrSpec *spec.Spec) ([]InspectMount, error)
if volume, ok := namedVolumes[vol]; ok {
mountStruct := InspectMount{}
mountStruct.Type = "volume"
- mountStruct.Dst = volume.Dest
+ mountStruct.Destination = volume.Dest
mountStruct.Name = volume.Name
// For src and driver, we need to look up the named
@@ -396,7 +396,7 @@ func (c *Container) getInspectMounts(ctrSpec *spec.Spec) ([]InspectMount, error)
return nil, errors.Wrapf(err, "error looking up volume %s in container %s config", volume.Name, c.ID())
}
mountStruct.Driver = volFromDB.Driver()
- mountStruct.Src = volFromDB.MountPoint()
+ mountStruct.Source = volFromDB.MountPoint()
parseMountOptionsForInspect(volume.Options, &mountStruct)
@@ -410,8 +410,8 @@ func (c *Container) getInspectMounts(ctrSpec *spec.Spec) ([]InspectMount, error)
mountStruct := InspectMount{}
mountStruct.Type = "bind"
- mountStruct.Src = mount.Source
- mountStruct.Dst = mount.Destination
+ mountStruct.Source = mount.Source
+ mountStruct.Destination = mount.Destination
parseMountOptionsForInspect(mount.Options, &mountStruct)