Expose RootFS in image inspect
Fixes #20451 Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Upstream-commit: 14dc4a7158a141b5c13aa63231e467f0c3235850 Component: engine
This commit is contained in:
@@ -1164,6 +1164,7 @@ func (daemon *Daemon) LookupImage(name string) (*types.ImageInspect, error) {
|
||||
Os: img.OS,
|
||||
Size: size,
|
||||
VirtualSize: size, // TODO: field unused, deprecate
|
||||
RootFS: rootFSToAPIType(img.RootFS),
|
||||
}
|
||||
|
||||
imageInspect.GraphDriver.Name = daemon.GraphDriverName()
|
||||
|
||||
@@ -1092,3 +1092,14 @@ func (daemon *Daemon) stats(c *container.Container) (*types.StatsJSON, error) {
|
||||
func (daemon *Daemon) setDefaultIsolation() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
var layers []string
|
||||
for _, l := range rootfs.DiffIDs {
|
||||
layers = append(layers, l.String())
|
||||
}
|
||||
return types.RootFS{
|
||||
Type: rootfs.Type,
|
||||
Layers: layers,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,3 +453,15 @@ func (daemon *Daemon) setDefaultIsolation() error {
|
||||
logrus.Infof("Windows default isolation mode: %s", daemon.defaultIsolation)
|
||||
return nil
|
||||
}
|
||||
|
||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
var layers []string
|
||||
for _, l := range rootfs.DiffIDs {
|
||||
layers = append(layers, l.String())
|
||||
}
|
||||
return types.RootFS{
|
||||
Type: rootfs.Type,
|
||||
Layers: layers,
|
||||
BaseLayer: rootfs.BaseLayer,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user