Merge pull request #1311 from abhinandanpb/client_int
Exposing helper functions to access internal image information
This commit is contained in:
commit
938810e706
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