Skip to content

Commit f88d3e5

Browse files
authored
Merge pull request #2685 from Random-Liu/expose-labels
Add `Labels()` to client.Image.
2 parents 4b1d56e + 3d5a408 commit f88d3e5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

image.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type Image interface {
3737
Name() string
3838
// Target descriptor for the image content
3939
Target() ocispec.Descriptor
40+
// Labels of the image
41+
Labels() map[string]string
4042
// Unpack unpacks the image's content into a snapshot
4143
Unpack(context.Context, string) error
4244
// RootFS returns the unpacked diffids that make up images rootfs.
@@ -86,6 +88,10 @@ func (i *image) Target() ocispec.Descriptor {
8688
return i.i.Target
8789
}
8890

91+
func (i *image) Labels() map[string]string {
92+
return i.i.Labels
93+
}
94+
8995
func (i *image) RootFS(ctx context.Context) ([]digest.Digest, error) {
9096
provider := i.client.ContentStore()
9197
return i.i.RootFS(ctx, provider, i.platform)

0 commit comments

Comments
 (0)