mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/images: ImageService.LookupImage(): minor cleanup
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
e1ea911aba
commit
f5db4b01c0
1 changed files with 7 additions and 8 deletions
|
@ -59,7 +59,7 @@ func (i *ImageService) LookupImage(name string) (*types.ImageInspect, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
imageInspect := &types.ImageInspect{
|
return &types.ImageInspect{
|
||||||
ID: img.ID().String(),
|
ID: img.ID().String(),
|
||||||
RepoTags: repoTags,
|
RepoTags: repoTags,
|
||||||
RepoDigests: repoDigests,
|
RepoDigests: repoDigests,
|
||||||
|
@ -77,16 +77,15 @@ func (i *ImageService) LookupImage(name string) (*types.ImageInspect, error) {
|
||||||
OsVersion: img.OSVersion,
|
OsVersion: img.OSVersion,
|
||||||
Size: size,
|
Size: size,
|
||||||
VirtualSize: size, // TODO: field unused, deprecate
|
VirtualSize: size, // TODO: field unused, deprecate
|
||||||
RootFS: rootFSToAPIType(img.RootFS),
|
GraphDriver: types.GraphDriverData{
|
||||||
|
Name: i.layerStore.DriverName(),
|
||||||
|
Data: layerMetadata,
|
||||||
|
},
|
||||||
|
RootFS: rootFSToAPIType(img.RootFS),
|
||||||
Metadata: types.ImageMetadata{
|
Metadata: types.ImageMetadata{
|
||||||
LastTagTime: lastUpdated,
|
LastTagTime: lastUpdated,
|
||||||
},
|
},
|
||||||
}
|
}, nil
|
||||||
|
|
||||||
imageInspect.GraphDriver.Name = i.layerStore.DriverName()
|
|
||||||
imageInspect.GraphDriver.Data = layerMetadata
|
|
||||||
|
|
||||||
return imageInspect, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||||
|
|
Loading…
Add table
Reference in a new issue