diff --git a/internal/hcapi2/image.go b/internal/hcapi2/image.go index b668e870..a151768c 100644 --- a/internal/hcapi2/image.go +++ b/internal/hcapi2/image.go @@ -43,10 +43,14 @@ func (c *imageClient) Names() []string { return names } -// ImageLabelKeys returns a slice containing the keys of all labels assigned to -// the Image with the passed idOrName. -func (c *imageClient) LabelKeys(idOrName string) []string { - img, _, err := c.Get(context.Background(), idOrName) +// LabelKeys returns a slice containing the keys of all labels assigned to +// the Image with the passed id. +func (c *imageClient) LabelKeys(id string) []string { + imgID, err := strconv.ParseInt(id, 10, 64) + if err != nil { + return nil + } + img, _, err := c.GetByID(context.Background(), imgID) if err != nil || img == nil || len(img.Labels) == 0 { return nil }