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

Commit 350ab29

Browse files
authored
Merge pull request #656 from rumpl/rework-image-list
Merge repo and tag on image list
2 parents 93e0d2b + 5f39a97 commit 350ab29

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

e2e/images_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313

1414
var (
1515
reg = regexp.MustCompile("Digest is (.*).")
16-
expected = `REPOSITORY TAG APP NAME
17-
%s push-pull
18-
a-simple-app latest simple
19-
b-simple-app latest simple
16+
expected = `APP IMAGE APP NAME
17+
%s push-pull
18+
a-simple-app:latest simple
19+
b-simple-app:latest simple
2020
`
2121
)
2222

@@ -48,9 +48,9 @@ func TestImageList(t *testing.T) {
4848
dir := fs.NewDir(t, "")
4949
defer dir.Remove()
5050

51-
insertBundles(t, cmd, dir, info)
51+
digest := insertBundles(t, cmd, dir, info)
5252

53-
expectedOutput := fmt.Sprintf(expected, info.registryAddress+"/c-myapp")
53+
expectedOutput := fmt.Sprintf(expected, info.registryAddress+"/c-myapp@"+digest)
5454
cmd.Command = dockerCli.Command("app", "image", "ls")
5555
result := icmd.RunCmd(cmd).Assert(t, icmd.Success)
5656
assert.Equal(t, result.Stdout(), expectedOutput)
@@ -84,7 +84,7 @@ Deleted: b-simple-app:latest`,
8484
Err: `Error: no such image b-simple-app:latest`,
8585
})
8686

87-
expectedOutput := "REPOSITORY TAG APP NAME\n"
87+
expectedOutput := "APP IMAGE APP NAME\n"
8888
cmd.Command = dockerCli.Command("app", "image", "ls")
8989
result := icmd.RunCmd(cmd).Assert(t, icmd.Success)
9090
assert.Equal(t, result.Stdout(), expectedOutput)

internal/commands/image/list.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ func getPackages(bundleStore store.BundleStore, references []reference.Named) ([
6464
ref: ref,
6565
}
6666

67-
if r, ok := ref.(reference.NamedTagged); ok {
68-
pk.taggedRef = r
69-
}
70-
7167
packages[i] = pk
7268
}
7369

@@ -106,14 +102,8 @@ var (
106102
header string
107103
value func(p pkg) string
108104
}{
109-
{"REPOSITORY", func(p pkg) string {
110-
return reference.FamiliarName(p.ref)
111-
}},
112-
{"TAG", func(p pkg) string {
113-
if p.taggedRef != nil {
114-
return p.taggedRef.Tag()
115-
}
116-
return ""
105+
{"APP IMAGE", func(p pkg) string {
106+
return reference.FamiliarString(p.ref)
117107
}},
118108
{"APP NAME", func(p pkg) string {
119109
return p.bundle.Name
@@ -122,7 +112,6 @@ var (
122112
)
123113

124114
type pkg struct {
125-
ref reference.Named
126-
taggedRef reference.NamedTagged
127-
bundle *bundle.Bundle
115+
ref reference.Named
116+
bundle *bundle.Bundle
128117
}

0 commit comments

Comments
 (0)