@@ -14,8 +14,8 @@ class ImagesHelper {
14
14
15
15
extractFieldsForImageEntity ( image , tag ) {
16
16
const newImage = {
17
- name : image . imageDisplayName ,
18
- size : filesize ( image . size ) ,
17
+ name : image . imageDisplayName || image . imageName ,
18
+ size : image . size && filesize ( image . size ) ,
19
19
sha : image . sha ,
20
20
annotations : _ . get ( image , 'metadata' , { } ) ,
21
21
tagId : tag . _id ,
@@ -33,30 +33,24 @@ class ImagesHelper {
33
33
}
34
34
35
35
36
- extractImages ( images , filterRegistries ) {
36
+ extractImages ( images ) {
37
37
if ( ! _ . isArray ( images ) ) {
38
38
images = [ images ] ; // eslint-disable-line no-param-reassign
39
39
}
40
40
return _ . chain ( images )
41
41
. map ( ( image ) => {
42
42
const res = [ ] ;
43
- let addedCfCrTag = false ;
43
+ let volumeImage = false ;
44
44
_ . forEach ( image . tags , ( tag ) => {
45
45
if ( _ . isEqual ( tag . tag , 'volume' ) ) {
46
- addedCfCrTag = true ;
46
+ volumeImage = true ;
47
47
return ;
48
48
}
49
- // in case we are filtering by registries, ignore the image if it is not from the registires list
50
- if ( filterRegistries && ! _ . includes ( filterRegistries , tag . registry ) ) {
51
- return ;
52
- }
53
- if ( _ . includes ( DEFAULTS . CODEFRESH_REGISTRIES , tag . registry ) ) {
54
- addedCfCrTag = true ;
55
- }
49
+
56
50
const data = this . extractFieldsForImageEntity ( image , tag ) ;
57
51
res . push ( new Image ( data ) ) ;
58
52
} ) ;
59
- if ( _ . isEmpty ( image . tags ) || ! addedCfCrTag ) {
53
+ if ( _ . isEmpty ( image . tags ) && ! volumeImage ) {
60
54
const data = this . extractFieldsForImageEntity ( image , NONE_TAG ) ;
61
55
res . push ( new Image ( data ) ) ;
62
56
}
0 commit comments