Exposing helpers to access internal structure
Adding image.Config,image.Size,image.RootFS to retrieve the internal image information which will be needed by consumers of containerd Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
This commit is contained in:
parent
29a4dd7f46
commit
7a5d592372
14
image.go
14
image.go
@ -20,6 +20,10 @@ type Image interface {
|
||||
Target() ocispec.Descriptor
|
||||
// Unpack unpacks the image's content into a snapshot
|
||||
Unpack(context.Context, string) error
|
||||
// RootFS returns the image digests
|
||||
RootFS(ctx context.Context) ([]digest.Digest, error)
|
||||
// Size returns the image size
|
||||
Size(ctx context.Context) (int64, error)
|
||||
}
|
||||
|
||||
var _ = (Image)(&image{})
|
||||
@ -38,6 +42,16 @@ func (i *image) Target() ocispec.Descriptor {
|
||||
return i.i.Target
|
||||
}
|
||||
|
||||
func (i *image) RootFS(ctx context.Context) ([]digest.Digest, error) {
|
||||
provider := i.client.ContentStore()
|
||||
return i.i.RootFS(ctx, provider)
|
||||
}
|
||||
|
||||
func (i *image) Size(ctx context.Context) (int64, error) {
|
||||
provider := i.client.ContentStore()
|
||||
return i.i.Size(ctx, provider)
|
||||
}
|
||||
|
||||
func (i *image) Unpack(ctx context.Context, snapshotterName string) error {
|
||||
layers, err := i.getLayers(ctx)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user