@@ -30,9 +30,16 @@ func TestBuild(t *testing.T) {
30
30
cmd .Command = dockerCli .Command ("app" , "build" , "--tag" , "single:1.0.0" , "--iidfile" , iidfile , "-f" , path .Join (testDir , "single.dockerapp" ), testDir )
31
31
icmd .RunCmd (cmd ).Assert (t , icmd .Success )
32
32
33
+ _ , err := os .Stat (iidfile )
34
+ assert .NilError (t , err )
35
+ bytes , err := ioutil .ReadFile (iidfile )
36
+ assert .NilError (t , err )
37
+ iid := string (bytes )
38
+
33
39
cfg := getDockerConfigDir (t , cmd )
34
40
35
- f := path .Join (cfg , "app" , "bundles" , "docker.io" , "library" , "single" , "_tags" , "1.0.0" , image .BundleFilename )
41
+ s := strings .Split (iid , ":" )
42
+ f := path .Join (cfg , "app" , "bundles" , "contents" , s [0 ], s [1 ], image .BundleFilename )
36
43
bndl , err := image .FromFile (f )
37
44
assert .NilError (t , err )
38
45
@@ -47,11 +54,6 @@ func TestBuild(t *testing.T) {
47
54
assert .Assert (t , img .Image == "" || strings .Contains (img .Image , "@sha256:" ))
48
55
}
49
56
50
- _ , err = os .Stat (iidfile )
51
- assert .NilError (t , err )
52
- bytes , err := ioutil .ReadFile (iidfile )
53
- assert .NilError (t , err )
54
- iid := string (bytes )
55
57
actualID , err := store .FromAppImage (bndl )
56
58
assert .NilError (t , err )
57
59
assert .Equal (t , iid , fmt .Sprintf ("sha256:%s" , actualID .String ()))
@@ -67,31 +69,6 @@ func TestBuildMultiTag(t *testing.T) {
67
69
tags := []string {"1.0.0" , "latest" }
68
70
cmd .Command = dockerCli .Command ("app" , "build" , "--tag" , "single:" + tags [0 ], "--tag" , "single:" + tags [1 ], "--iidfile" , iidfile , "-f" , path .Join (testDir , "single.dockerapp" ), testDir )
69
71
icmd .RunCmd (cmd ).Assert (t , icmd .Success )
70
-
71
- cfg := getDockerConfigDir (t , cmd )
72
-
73
- for _ , tag := range tags {
74
- f := path .Join (cfg , "app" , "bundles" , "docker.io" , "library" , "single" , "_tags" , tag , image .BundleFilename )
75
- img , err := image .FromFile (f )
76
- assert .NilError (t , err )
77
- built := []string {img .InvocationImages [0 ].Digest , img .Images ["web" ].Digest , img .Images ["worker" ].Digest }
78
- for _ , ref := range built {
79
- cmd .Command = dockerCli .Command ("inspect" , ref )
80
- icmd .RunCmd (cmd ).Assert (t , icmd .Success )
81
- }
82
- for _ , img := range img .Images {
83
- // Check all image not being built locally get a fixed reference
84
- assert .Assert (t , img .Image == "" || strings .Contains (img .Image , "@sha256:" ))
85
- }
86
- _ , err = os .Stat (iidfile )
87
- assert .NilError (t , err )
88
- bytes , err := ioutil .ReadFile (iidfile )
89
- assert .NilError (t , err )
90
- iid := string (bytes )
91
- actualID , err := store .FromAppImage (img )
92
- assert .NilError (t , err )
93
- assert .Equal (t , iid , fmt .Sprintf ("sha256:%s" , actualID .String ()))
94
- }
95
72
})
96
73
}
97
74
@@ -126,13 +103,13 @@ func TestBuildWithoutTag(t *testing.T) {
126
103
127
104
cfg := getDockerConfigDir (t , cmd )
128
105
129
- f := path .Join (cfg , "app" , "bundles" , "_ids " )
106
+ f := path .Join (cfg , "app" , "bundles" , "contents" , "sha256 " )
130
107
infos , err := ioutil .ReadDir (f )
131
108
assert .NilError (t , err )
132
109
assert .Equal (t , len (infos ), 1 )
133
110
id := infos [0 ].Name ()
134
111
135
- f = path .Join (cfg , "app" , "bundles" , "_ids " , id , image .BundleFilename )
112
+ f = path .Join (cfg , "app" , "bundles" , "contents" , "sha256 " , id , image .BundleFilename )
136
113
data , err := ioutil .ReadFile (f )
137
114
assert .NilError (t , err )
138
115
var bndl bundle.Bundle
@@ -157,13 +134,13 @@ func TestBuildWithArgs(t *testing.T) {
157
134
158
135
cfg := getDockerConfigDir (t , cmd )
159
136
160
- f := path .Join (cfg , "app" , "bundles" , "_ids " )
137
+ f := path .Join (cfg , "app" , "bundles" , "contents" , "sha256 " )
161
138
infos , err := ioutil .ReadDir (f )
162
139
assert .NilError (t , err )
163
140
assert .Equal (t , len (infos ), 1 )
164
141
id := infos [0 ].Name ()
165
142
166
- f = path .Join (cfg , "app" , "bundles" , "_ids " , id , image .BundleFilename )
143
+ f = path .Join (cfg , "app" , "bundles" , "contents" , "sha256 " , id , image .BundleFilename )
167
144
data , err := ioutil .ReadFile (f )
168
145
assert .NilError (t , err )
169
146
var bndl bundle.Bundle
0 commit comments