Merge pull request #2685 from Random-Liu/expose-labels

Add `Labels()` to client.Image.
This commit is contained in:
Derek McGowan
2018-09-26 10:25:42 -07:00
committed by GitHub

View File

@@ -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)