Add image config function.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
2f237b2fde
commit
76e016ca30
11
image.go
11
image.go
@ -20,10 +20,12 @@ type Image interface {
|
|||||||
Target() ocispec.Descriptor
|
Target() ocispec.Descriptor
|
||||||
// Unpack unpacks the image's content into a snapshot
|
// Unpack unpacks the image's content into a snapshot
|
||||||
Unpack(context.Context, string) error
|
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)
|
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)
|
Size(ctx context.Context) (int64, error)
|
||||||
|
// Config descriptor for the image.
|
||||||
|
Config(ctx context.Context) (ocispec.Descriptor, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = (Image)(&image{})
|
var _ = (Image)(&image{})
|
||||||
@ -52,6 +54,11 @@ func (i *image) Size(ctx context.Context) (int64, error) {
|
|||||||
return i.i.Size(ctx, provider)
|
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 {
|
func (i *image) Unpack(ctx context.Context, snapshotterName string) error {
|
||||||
layers, err := i.getLayers(ctx)
|
layers, err := i.getLayers(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user