@@ -276,23 +276,26 @@ func TestExpandImageIndex(t *testing.T) {
276
276
}
277
277
278
278
expandImageIndex (ctx , snap )
279
- assert .True (t , len (snap .Components ) == 3 , "Image Index itself should be removed and be replaced by individual image manifests " )
279
+ assert .True (t , len (snap .Components ) == 4 , "Image Index should NOT be removed " )
280
280
281
- amd64Image , arm64Image , noarchImage := false , false , false
282
- for _ , archImage := range snap .Components {
283
- switch {
284
- case strings .Contains (archImage .Name , "some-image-name-sha256:digest1-amd64" ):
281
+ indexImage , amd64Image , arm64Image , noarchImage := false , false , false , false
282
+ for _ , component := range snap .Components {
283
+ switch component .Name {
284
+ case "some-image-name" :
285
+ indexImage = true
286
+ case "some-image-name-sha256:digest1-amd64" :
285
287
amd64Image = true
286
- case strings . Contains ( archImage . Name , "some-image-name-sha256:digest2-arm64" ) :
288
+ case "some-image-name-sha256:digest2-arm64" :
287
289
arm64Image = true
288
- case strings . Contains ( archImage . Name , "some-image-name-sha256:digest3-noarch-2" ) :
290
+ case "some-image-name-sha256:digest3-noarch-2" :
289
291
noarchImage = true
290
292
}
291
293
}
292
294
293
- assert .True (t , amd64Image , "An amd64 image should be present in the component" )
294
- assert .True (t , arm64Image , "An arm64 image should be present in the component" )
295
- assert .True (t , noarchImage , "A noarch image should be present in the component" )
295
+ assert .True (t , indexImage , "Index Image should be present in components" )
296
+ assert .True (t , amd64Image , "An amd64 image should be present in components" )
297
+ assert .True (t , arm64Image , "An arm64 image should be present in components" )
298
+ assert .True (t , noarchImage , "A noarch image should be present in components" )
296
299
}
297
300
298
301
func TestExpandImageImage_Errors (t * testing.T ) {
0 commit comments