Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
dont show id as repository in image ls
Browse files Browse the repository at this point in the history
When running `image ls` images without a repository no longer print
their ID as their repository.

Signed-off-by: Nick Adcock <[email protected]>
  • Loading branch information
zappy-shu committed Nov 7, 2019
1 parent 8acd0a8 commit c19f7d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/commands/image/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func getImageListColumns(options imageListOption) []imageListColumn {
if n, ok := p.ref.(reference.Named); ok {
return reference.FamiliarName(n)
}
return reference.FamiliarString(p.ref)
return "<none>"
}},
{"TAG", func(p pkg) string {
if t, ok := p.ref.(reference.Tagged); ok {
Expand Down
16 changes: 8 additions & 8 deletions internal/commands/image/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ func TestListCmd(t *testing.T) {
}{
{
name: "TestList",
expectedOutput: `REPOSITORY TAG APP IMAGE ID APP NAME
foo/bar <none> 3f825b2d0657 Digested App
foo/bar 1.0 9aae408ee04f Foo App
a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 <none> a855ac937f2e Quiet App
expectedOutput: `REPOSITORY TAG APP IMAGE ID APP NAME
foo/bar <none> 3f825b2d0657 Digested App
foo/bar 1.0 9aae408ee04f Foo App
<none> <none> a855ac937f2e Quiet App
`,
options: imageListOption{},
},
{
name: "TestListWithDigests",
expectedOutput: `REPOSITORY TAG DIGEST APP IMAGE ID APP NAME
foo/bar <none> sha256:b59492bb814012ca3d2ce0b6728242d96b4af41687cc82166a4b5d7f2d9fb865 3f825b2d0657 Digested App
foo/bar 1.0 <none> 9aae408ee04f Foo App
a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 <none> sha256:a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 a855ac937f2e Quiet App
expectedOutput: `REPOSITORY TAG DIGEST APP IMAGE ID APP NAME
foo/bar <none> sha256:b59492bb814012ca3d2ce0b6728242d96b4af41687cc82166a4b5d7f2d9fb865 3f825b2d0657 Digested App
foo/bar 1.0 <none> 9aae408ee04f Foo App
<none> <none> sha256:a855ac937f2ed375ba4396bbc49c4093e124da933acd2713fb9bc17d7562a087 a855ac937f2e Quiet App
`,
options: imageListOption{digests: true},
},
Expand Down

0 comments on commit c19f7d4

Please sign in to comment.