Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 71ad534

Browse files
authored
Merge pull request #728 from zappy-shu/dont-show-id-as-repository
Don't show ID as repository in image ls
2 parents 8acd0a8 + c19f7d4 commit 71ad534

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

internal/commands/image/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func getImageListColumns(options imageListOption) []imageListColumn {
148148
if n, ok := p.ref.(reference.Named); ok {
149149
return reference.FamiliarName(n)
150150
}
151-
return reference.FamiliarString(p.ref)
151+
return "<none>"
152152
}},
153153
{"TAG", func(p pkg) string {
154154
if t, ok := p.ref.(reference.Tagged); ok {

internal/commands/image/list_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ func TestListCmd(t *testing.T) {
7575
}{
7676
{
7777
name: "TestList",
78-
expectedOutput: `REPOSITORY TAG APP IMAGE ID APP NAME
79-
foo/bar <none> 3f825b2d0657 Digested App
80-
foo/bar 1.0 9aae408ee04f Foo App
81-
a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 <none> a855ac937f2e Quiet App
78+
expectedOutput: `REPOSITORY TAG APP IMAGE ID APP NAME
79+
foo/bar <none> 3f825b2d0657 Digested App
80+
foo/bar 1.0 9aae408ee04f Foo App
81+
<none> <none> a855ac937f2e Quiet App
8282
`,
8383
options: imageListOption{},
8484
},
8585
{
8686
name: "TestListWithDigests",
87-
expectedOutput: `REPOSITORY TAG DIGEST APP IMAGE ID APP NAME
88-
foo/bar <none> sha256:b59492bb814012ca3d2ce0b6728242d96b4af41687cc82166a4b5d7f2d9fb865 3f825b2d0657 Digested App
89-
foo/bar 1.0 <none> 9aae408ee04f Foo App
90-
a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 <none> sha256:a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 a855ac937f2e Quiet App
87+
expectedOutput: `REPOSITORY TAG DIGEST APP IMAGE ID APP NAME
88+
foo/bar <none> sha256:b59492bb814012ca3d2ce0b6728242d96b4af41687cc82166a4b5d7f2d9fb865 3f825b2d0657 Digested App
89+
foo/bar 1.0 <none> 9aae408ee04f Foo App
90+
<none> <none> sha256:a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 a855ac937f2e Quiet App
9191
`,
9292
options: imageListOption{digests: true},
9393
},

0 commit comments

Comments
 (0)