@@ -210,6 +210,189 @@ describe('parseInspect', () => {
210
210
}
211
211
]
212
212
}
213
+ ] ,
214
+ [
215
+ 'inspect8.txt' ,
216
+ {
217
+ "name" : "builder-52aa0611-faf0-42ac-a940-461e4e287d68" ,
218
+ "driver" : "docker-container" ,
219
+ "lastActivity" : new Date ( "2023-06-13T13:52:31.000Z" ) ,
220
+ "nodes" : [
221
+ {
222
+ "buildkit" : "v0.11.6" ,
223
+ "buildkitd-flags" : "--debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" ,
224
+ "driver-opts" : [
225
+ "image=moby/buildkit:buildx-stable-1" ,
226
+ "network=host" ,
227
+ ] ,
228
+ "endpoint" : "unix:///var/run/docker.sock" ,
229
+ "name" : "builder-52aa0611-faf0-42ac-a940-461e4e287d680" ,
230
+ "platforms" : "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6" ,
231
+ "status" : "running" ,
232
+ "labels" : {
233
+ "org.mobyproject.buildkit.worker.executor" : "oci" ,
234
+ "org.mobyproject.buildkit.worker.hostname" : "fv-az572-38" ,
235
+ "org.mobyproject.buildkit.worker.network" : "host" ,
236
+ "org.mobyproject.buildkit.worker.oci.process-mode" : "sandbox" ,
237
+ "org.mobyproject.buildkit.worker.selinux.enabled" : "false" ,
238
+ "org.mobyproject.buildkit.worker.snapshotter" : "overlayfs" ,
239
+ } ,
240
+ "gcPolicy" : [
241
+ {
242
+ "all" : false ,
243
+ "filter" : [
244
+ "type==source.local" ,
245
+ "type==exec.cachemount" ,
246
+ "type==source.git.checkout"
247
+ ] ,
248
+ "keepDuration" : "48h0m0s" ,
249
+ "keepBytes" : "488.3MiB" ,
250
+ } ,
251
+ {
252
+ "all" : false ,
253
+ "keepDuration" : "1440h0m0s" ,
254
+ "keepBytes" : "8.382GiB" ,
255
+ } ,
256
+ {
257
+ "all" : false ,
258
+ "keepBytes" : "8.382GiB" ,
259
+ } ,
260
+ {
261
+ "all" : true ,
262
+ "keepBytes" : "8.382GiB" ,
263
+ }
264
+ ]
265
+ }
266
+ ]
267
+ }
268
+ ] ,
269
+ [
270
+ 'inspect9.txt' ,
271
+ {
272
+ "name" : "default" ,
273
+ "driver" : "docker" ,
274
+ "lastActivity" : new Date ( "2023-06-13T18:13:43.000Z" ) ,
275
+ "nodes" : [
276
+ {
277
+ "buildkit" : "v0.11.7-0.20230525183624-798ad6b0ce9f" ,
278
+ "endpoint" : "default" ,
279
+ "name" : "default" ,
280
+ "platforms" : "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6" ,
281
+ "status" : "running" ,
282
+ "gcPolicy" : [
283
+ {
284
+ "all" : true ,
285
+ "keepBytes" : "100GiB" ,
286
+ }
287
+ ]
288
+ }
289
+ ]
290
+ }
291
+ ] ,
292
+ [
293
+ 'inspect10.txt' ,
294
+ {
295
+ "name" : "remote-builder" ,
296
+ "driver" : "remote" ,
297
+ "lastActivity" : new Date ( "2023-04-20T12:47:49.000Z" ) ,
298
+ "nodes" : [
299
+ {
300
+ "name" : "remote-builder0" ,
301
+ "endpoint" : "docker-container://buildx_buildkit_dk-remote-builder0" ,
302
+ "status" : "inactive"
303
+ } ,
304
+ {
305
+ "name" : "aws_graviton2" ,
306
+ "endpoint" : "tcp://10.0.0.1:1234" ,
307
+ "driver-opts" : [
308
+ "cacert=/home/user/.certs/aws_graviton2/ca.pem" ,
309
+ "cert=/home/user/.certs/aws_graviton2/cert.pem" ,
310
+ "key=/home/user/.certs/aws_graviton2/key.pem"
311
+ ] ,
312
+ "status" : "running" ,
313
+ "buildkit" : "v0.11.6" ,
314
+ "platforms" : "darwin/arm64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,windows/arm64" ,
315
+ "labels" : {
316
+ "org.mobyproject.buildkit.worker.executor" : "oci" ,
317
+ "org.mobyproject.buildkit.worker.hostname" : "77ebc22e2d82" ,
318
+ "org.mobyproject.buildkit.worker.network" : "host" ,
319
+ "org.mobyproject.buildkit.worker.oci.process-mode" : "sandbox" ,
320
+ "org.mobyproject.buildkit.worker.selinux.enabled" : "false" ,
321
+ "org.mobyproject.buildkit.worker.snapshotter" : "overlayfs"
322
+ } ,
323
+ "gcPolicy" : [
324
+ {
325
+ "all" : false ,
326
+ "filter" : [
327
+ "type==source.local" ,
328
+ "type==exec.cachemount" ,
329
+ "type==source.git.checkout"
330
+ ] ,
331
+ "keepDuration" : "48h0m0s" ,
332
+ "keepBytes" : "488.3MiB"
333
+ } ,
334
+ {
335
+ "all" : false ,
336
+ "keepDuration" : "1440h0m0s" ,
337
+ "keepBytes" : "23.28GiB"
338
+ } ,
339
+ {
340
+ "all" : false ,
341
+ "keepBytes" : "23.28GiB"
342
+ } ,
343
+ {
344
+ "all" : true ,
345
+ "keepBytes" : "23.28GiB"
346
+ }
347
+ ]
348
+ } ,
349
+ {
350
+ "name" : "linuxone_s390x" ,
351
+ "endpoint" : "tcp://10.0.0.2:1234" ,
352
+ "driver-opts" : [
353
+ "cacert=/home/user/.certs/linuxone_s390x/ca.pem" ,
354
+ "cert=/home/user/.certs/linuxone_s390x/cert.pem" ,
355
+ "key=/home/user/.certs/linuxone_s390x/key.pem"
356
+ ] ,
357
+ "status" : "running" ,
358
+ "buildkit" : "v0.11.6" ,
359
+ "platforms" : "linux/s390x" ,
360
+ "labels" : {
361
+ "org.mobyproject.buildkit.worker.executor" : "oci" ,
362
+ "org.mobyproject.buildkit.worker.hostname" : "9d0d62a96818" ,
363
+ "org.mobyproject.buildkit.worker.network" : "host" ,
364
+ "org.mobyproject.buildkit.worker.oci.process-mode" : "sandbox" ,
365
+ "org.mobyproject.buildkit.worker.selinux.enabled" : "false" ,
366
+ "org.mobyproject.buildkit.worker.snapshotter" : "overlayfs"
367
+ } ,
368
+ "gcPolicy" : [
369
+ {
370
+ "all" : false ,
371
+ "keepBytes" : "488.3MiB" ,
372
+ "filter" : [
373
+ "type==source.local" ,
374
+ "type==exec.cachemount" ,
375
+ "type==source.git.checkout"
376
+ ] ,
377
+ "keepDuration" : "48h0m0s"
378
+ } ,
379
+ {
380
+ "all" : false ,
381
+ "keepDuration" : "1440h0m0s" ,
382
+ "keepBytes" : "9.313GiB"
383
+ } ,
384
+ {
385
+ "all" : false ,
386
+ "keepBytes" : "9.313GiB"
387
+ } ,
388
+ {
389
+ "all" : true ,
390
+ "keepBytes" : "9.313GiB"
391
+ }
392
+ ]
393
+ }
394
+ ] ,
395
+ }
213
396
]
214
397
] ) ( 'given %p' , async ( inspectFile , expected ) => {
215
398
expect ( await Builder . parseInspect ( fs . readFileSync ( path . join ( fixturesDir , inspectFile ) ) . toString ( ) ) ) . toEqual ( expected ) ;
0 commit comments