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

Commit b0bb564

Browse files
Merge pull request #739 from zappy-shu/add-creation-to-bundles
PR followup for add creation to bundles
2 parents aaa673f + d324765 commit b0bb564

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

e2e/images_test.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package e2e
22

33
import (
44
"bufio"
5-
"fmt"
65
"path/filepath"
76
"regexp"
87
"strings"
@@ -25,10 +24,8 @@ func insertBundles(t *testing.T, cmd icmd.Cmd) {
2524
func assertImageListOutput(t *testing.T, cmd icmd.Cmd, expected string) {
2625
result := icmd.RunCmd(cmd).Assert(t, icmd.Success)
2726
stdout := result.Stdout()
28-
match, _ := regexp.MatchString(expected, stdout)
29-
if !match {
30-
fmt.Println(stdout)
31-
}
27+
match, err := regexp.MatchString(expected, stdout)
28+
assert.NilError(t, err)
3229
assert.Assert(t, match)
3330
}
3431

@@ -42,22 +39,18 @@ func expectImageListDigestsOutput(t *testing.T, cmd icmd.Cmd, output string) {
4239
assertImageListOutput(t, cmd, output)
4340
}
4441

45-
func verifyImageIDListOutput(t *testing.T, cmd icmd.Cmd, count int, distinct int) {
42+
func verifyImageIDListOutput(t *testing.T, cmd icmd.Cmd, expectedCount int) {
4643
cmd.Command = dockerCli.Command("app", "image", "ls", "-q")
4744
result := icmd.RunCmd(cmd).Assert(t, icmd.Success)
4845
scanner := bufio.NewScanner(strings.NewReader(result.Stdout()))
49-
lines := []string{}
50-
counter := make(map[string]int)
46+
count := 0
5147
for scanner.Scan() {
52-
lines = append(lines, scanner.Text())
53-
counter[scanner.Text()]++
54-
fmt.Println(scanner.Text())
48+
count++
5549
}
5650
if err := scanner.Err(); err != nil {
5751
assert.Error(t, err, "Verification failed")
5852
}
59-
assert.Equal(t, len(lines), count)
60-
assert.Equal(t, len(counter), distinct)
53+
assert.Equal(t, expectedCount, count)
6154
}
6255

6356
func TestImageList(t *testing.T) {
@@ -79,7 +72,7 @@ func TestImageListQuiet(t *testing.T) {
7972
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
8073
cmd := info.configuredCmd
8174
insertBundles(t, cmd)
82-
verifyImageIDListOutput(t, cmd, 3, 3)
75+
verifyImageIDListOutput(t, cmd, 3)
8376
})
8477
}
8578

internal/packager/cnab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func ToCNAB(app *types.App, invocationImageName string) (*bundle.Bundle, error)
172172
SchemaVersion: CNABVersion1_0_0,
173173
Custom: map[string]interface{}{
174174
internal.CustomDockerAppName: DockerAppCustom{
175-
Version: DockerAppCustomVersion1_0_0,
175+
Version: DockerAppCustomVersionCurrent,
176176
Payload: payload,
177177
},
178178
},

0 commit comments

Comments
 (0)