Skip to content

Commit

Permalink
Merge pull request #1444 from Random-Liu/add-image-config
Browse files Browse the repository at this point in the history
Add image config function.
  • Loading branch information
stevvooe committed Aug 31, 2017
2 parents 0baecaa + 76e016c commit c1c2aaf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions image.go
Expand Up @@ -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{})
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c1c2aaf

Please sign in to comment.