@@ -2,7 +2,6 @@ package e2e
2
2
3
3
import (
4
4
"bufio"
5
- "fmt"
6
5
"path/filepath"
7
6
"regexp"
8
7
"strings"
@@ -12,9 +11,9 @@ import (
12
11
"gotest.tools/icmd"
13
12
)
14
13
15
- func insertBundles (t * testing.T , cmd icmd.Cmd , info dindSwarmAndRegistryInfo ) {
14
+ func insertBundles (t * testing.T , cmd icmd.Cmd ) {
16
15
// Push an application so that we can later pull it by digest
17
- cmd .Command = dockerCli .Command ("app" , "build" , "--no-resolve-image" , "--tag" , info . registryAddress + " /c-myapp" , filepath .Join ("testdata" , "push-pull" ))
16
+ cmd .Command = dockerCli .Command ("app" , "build" , "--no-resolve-image" , "--tag" , "my.registry:5000 /c-myapp" , filepath .Join ("testdata" , "push-pull" ))
18
17
icmd .RunCmd (cmd ).Assert (t , icmd .Success )
19
18
cmd .Command = dockerCli .Command ("app" , "build" , "--no-resolve-image" , "--tag" , "b-simple-app" , filepath .Join ("testdata" , "simple" ))
20
19
icmd .RunCmd (cmd ).Assert (t , icmd .Success )
@@ -59,15 +58,14 @@ func TestImageList(t *testing.T) {
59
58
runWithDindSwarmAndRegistry (t , func (info dindSwarmAndRegistryInfo ) {
60
59
cmd := info .configuredCmd
61
60
62
- insertBundles (t , cmd , info )
61
+ insertBundles (t , cmd )
63
62
64
- expected := `REPOSITORY TAG APP IMAGE ID APP NAME
65
- %s latest [a-f0-9]{12} push-pull
66
- a -simple-app latest [a-f0-9]{12} simple
67
- b-simple-app latest [a-f0-9]{12} simple
63
+ expected := `REPOSITORY TAG APP IMAGE ID APP NAME
64
+ a-simple-app latest [a-f0-9]{12} simple
65
+ b -simple-app latest [a-f0-9]{12} simple
66
+ my.registry:5000/c-myapp latest [a-f0-9]{12} push-pull
68
67
`
69
- expectedOutput := fmt .Sprintf (expected , info .registryAddress + "/c-myapp" )
70
- expectImageListOutput (t , cmd , expectedOutput )
68
+ expectImageListOutput (t , cmd , expected )
71
69
})
72
70
}
73
71
@@ -97,12 +95,12 @@ func TestImageRm(t *testing.T) {
97
95
runWithDindSwarmAndRegistry (t , func (info dindSwarmAndRegistryInfo ) {
98
96
cmd := info .configuredCmd
99
97
100
- insertBundles (t , cmd , info )
98
+ insertBundles (t , cmd )
101
99
102
- cmd .Command = dockerCli .Command ("app" , "image" , "rm" , info . registryAddress + " /c-myapp:latest" )
100
+ cmd .Command = dockerCli .Command ("app" , "image" , "rm" , "my.registry:5000 /c-myapp:latest" )
103
101
icmd .RunCmd (cmd ).Assert (t , icmd.Expected {
104
102
ExitCode : 0 ,
105
- Out : "Deleted: " + info . registryAddress + " /c-myapp:latest" ,
103
+ Out : "Deleted: my.registry:5000 /c-myapp:latest" ,
106
104
})
107
105
108
106
cmd .Command = dockerCli .Command ("app" , "image" , "rm" , "a-simple-app" , "b-simple-app:latest" )
0 commit comments