Skip to content

Commit 83afd38

Browse files
committed
feat: don't include from arrays in tree
as the backend doesn't need these anymore, and it reduces the result json size by factor of ~3x
1 parent 28367a0 commit 83afd38

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

lib/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function convertDependecies(targetImage, scanResults) {
7575
root = {};
7676
root.name = imageName;
7777
root.version = imageVersion;
78-
root.from = [imageName + '@' + imageVersion];
7978

8079
var scanResult = scanResults.filter(function (res) {
8180
return res.Analysis && res.Analysis.length > 0;
@@ -103,10 +102,6 @@ function convertDependecies(targetImage, scanResults) {
103102
name: name,
104103
version: version,
105104
dependencies: {},
106-
from: [
107-
root['from'][0],
108-
name + '@' + version,
109-
],
110105
}
111106
return acc;
112107
}, {});

test/system.test.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ test('inspect nginx:1.13.10', function (t) {
8181
name: imgName,
8282
version: imgTag,
8383
packageFormatVersion: 'deb:0.0.1',
84-
from: [imgName + '@' + imgTag],
8584
}, 'root pkg');
8685

8786
const deps = pkg.dependencies;
@@ -91,34 +90,18 @@ test('inspect nginx:1.13.10', function (t) {
9190
acl: {
9291
name: 'acl',
9392
version: '2.2.52-3+b1',
94-
from: [
95-
'nginx@1.13.10',
96-
'acl@2.2.52-3+b1',
97-
],
9893
},
9994
adduser: {
10095
name: 'adduser',
10196
version: '3.115',
102-
from: [
103-
'nginx@1.13.10',
104-
'adduser@3.115',
105-
],
10697
},
10798
'nginx-module-xslt': {
10899
name: 'nginx-module-xslt',
109100
version: '1.13.10-1~stretch',
110-
from: [
111-
'nginx@1.13.10',
112-
'nginx-module-xslt@1.13.10-1~stretch',
113-
],
114101
},
115102
openssl: {
116103
name: 'openssl',
117104
version: '1.1.0f-3+deb9u1',
118-
from: [
119-
'nginx@1.13.10',
120-
'openssl@1.1.0f-3+deb9u1',
121-
],
122105
},
123106
}, 'deps');
124107
});
@@ -142,7 +125,6 @@ test('inspect redis:3.2.11-alpine', function (t) {
142125
name: imgName,
143126
version: imgTag,
144127
packageFormatVersion: 'apk:0.0.1',
145-
from: [imgName + '@' + imgTag],
146128
}, 'root pkg');
147129

148130
const deps = pkg.dependencies;
@@ -152,10 +134,6 @@ test('inspect redis:3.2.11-alpine', function (t) {
152134
busybox: {
153135
name: 'busybox',
154136
version: '1.27.2-r7',
155-
from: [
156-
imgName + '@' + imgTag,
157-
'busybox@1.27.2-r7',
158-
],
159137
},
160138
'libressl2.6-libcrypto': {
161139
name: 'libressl2.6-libcrypto',
@@ -188,7 +166,6 @@ test('inspect centos', function (t) {
188166
name: imgName,
189167
version: imgTag,
190168
packageFormatVersion: 'rpm:0.0.1',
191-
from: [imgName + '@' + imgTag],
192169
}, 'root pkg');
193170

194171
const deps = pkg.dependencies;
@@ -198,10 +175,6 @@ test('inspect centos', function (t) {
198175
'openssl-libs': {
199176
name: 'openssl-libs',
200177
version: '1:1.0.2k-8.el7',
201-
from: [
202-
imgName + '@' + imgTag,
203-
'openssl-libs@1:1.0.2k-8.el7',
204-
],
205178
},
206179
passwd: {
207180
name: 'passwd',

0 commit comments

Comments
 (0)