From 3d5a408bfa8803617a76a89ea4fcc70dfe8c21df Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Wed, 26 Sep 2018 00:42:13 -0700 Subject: [PATCH] Add `Labels` to client.Image. Signed-off-by: Lantao Liu --- image.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/image.go b/image.go index f12cd59c0..62fba9de7 100644 --- a/image.go +++ b/image.go @@ -37,6 +37,8 @@ type Image interface { Name() string // Target descriptor for the image content Target() ocispec.Descriptor + // Labels of the image + Labels() map[string]string // Unpack unpacks the image's content into a snapshot Unpack(context.Context, string) error // RootFS returns the unpacked diffids that make up images rootfs. @@ -86,6 +88,10 @@ func (i *image) Target() ocispec.Descriptor { return i.i.Target } +func (i *image) Labels() map[string]string { + return i.i.Labels +} + func (i *image) RootFS(ctx context.Context) ([]digest.Digest, error) { provider := i.client.ContentStore() return i.i.RootFS(ctx, provider, i.platform)