Merge pull request #1444 from Random-Liu/add-image-config

Add image config function.
This commit is contained in:
Stephen Day 2017-08-30 17:27:23 -07:00 committed by GitHub
commit c1c2aafffe

View File

@ -20,10 +20,12 @@ 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 returns the unpacked diffids that make up images rootfs.
RootFS(ctx context.Context) ([]digest.Digest, error)
// Size returns the image size
// Size returns the total size of the image's packed resources.
Size(ctx context.Context) (int64, error)
// Config descriptor for the image.
Config(ctx context.Context) (ocispec.Descriptor, error)
}
var _ = (Image)(&image{})
@ -52,6 +54,11 @@ func (i *image) Size(ctx context.Context) (int64, error) {
return i.i.Size(ctx, provider)
}
func (i *image) Config(ctx context.Context) (ocispec.Descriptor, error) {
provider := i.client.ContentStore()
return i.i.Config(ctx, provider)
}
func (i *image) Unpack(ctx context.Context, snapshotterName string) error {
layers, err := i.getLayers(ctx)
if err != nil {