diff --git a/cmd/uc/image/ls.go b/cmd/uc/image/ls.go index 43679e42..de1e1f0f 100644 --- a/cmd/uc/image/ls.go +++ b/cmd/uc/image/ls.go @@ -143,22 +143,14 @@ func list(ctx context.Context, uncli *cli.CLI, opts listOptions) error { return nil } -// imageRows keeps every tag visible and retains digest-only and unnamed images. +// imageRows keeps every stored name visible and retains digest-only and unnamed images. func imageRows(images []image.Summary, machineName, store string) []imageRow { var rows []imageRow for _, img := range images { - imageRefs := api.ImageReferences(img) - var imageNames []string - for _, ref := range imageRefs { - if !strings.Contains(ref, "@") { - imageNames = append(imageNames, ref) - } - } + // RepoTags includes stored digest names on containerd. RepoDigests can include derived names. + imageNames := img.RepoTags if len(imageNames) == 0 { - imageNames = imageRefs - } - if len(imageNames) == 0 { - imageNames = []string{""} + imageNames = []string{""} } imgPlatforms, _ := imagePlatforms(img) diff --git a/pkg/api/image.go b/pkg/api/image.go index 0ca05748..89105868 100644 --- a/pkg/api/image.go +++ b/pkg/api/image.go @@ -1,8 +1,6 @@ package api import ( - "slices" - "github.com/distribution/reference" "github.com/docker/docker/api/types/image" v1 "github.com/opencontainers/image-spec/specs-go/v1"