From f0e70a699da767e75fe3e68cffb4887ef60c643d Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Thu, 26 Dec 2024 20:12:23 +0000 Subject: [PATCH] Support for fail-on-error for container sbom generation. Env variable to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian --- .github/workflows/dockertests.yml | 1 + lib/managers/docker.js | 2 ++ types/lib/managers/docker.d.ts.map | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dockertests.yml b/.github/workflows/dockertests.yml index d7076a0e0..8ff3063ce 100644 --- a/.github/workflows/dockertests.yml +++ b/.github/workflows/dockertests.yml @@ -12,6 +12,7 @@ concurrency: jobs: linux-tests: strategy: + fail-fast: true matrix: os: [ubuntu-latest] node-version: ['23.x'] diff --git a/lib/managers/docker.js b/lib/managers/docker.js index 3917f8cde..4bda7938c 100644 --- a/lib/managers/docker.js +++ b/lib/managers/docker.js @@ -866,6 +866,8 @@ export const extractTar = async (fullImageName, dir, options) => { } else if (err.code === "TAR_BAD_ARCHIVE") { if (DEBUG_MODE) { console.log(`Archive ${fullImageName} is empty. Skipping.`); + // Empty tar images need not lead to failure. + return false; } } else if (["EACCES"].includes(err.code)) { console.log(err); diff --git a/types/lib/managers/docker.d.ts.map b/types/lib/managers/docker.d.ts.map index fccd5deb7..b38bd60ae 100644 --- a/types/lib/managers/docker.d.ts.map +++ b/types/lib/managers/docker.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../lib/managers/docker.js"],"names":[],"mappings":"AAgFA;;GAEG;AACH,4CA6CC;AApGD,4BAA6C;AAC7C,kCAAmC,WAAW,CAAC;AAkCxC,kDAeN;AA6DM,iCAHI,MAAM,WACN,MAAM,iDAehB;AAqBM,6DAmBN;AAgLM,4EAsGN;AAEM,oFAwBN;AAUM;;;;;;;;EAwEN;AAsBM,2DA6KN;AAgBM,yFA+FN;AAMM;;;;;;;;;;;;;GAuDN;AAEM;;;;;;;GAuGN;AAMM,4EA4IN;AAKM,4EAmGN;AAEM,+EAMN;AAEM,4EAyCN;AAEM,iFA0BN"} \ No newline at end of file +{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../lib/managers/docker.js"],"names":[],"mappings":"AAgFA;;GAEG;AACH,4CA6CC;AApGD,4BAA6C;AAC7C,kCAAmC,WAAW,CAAC;AAkCxC,kDAeN;AA6DM,iCAHI,MAAM,WACN,MAAM,iDAehB;AAqBM,6DAmBN;AAgLM,4EAsGN;AAEM,oFAwBN;AAUM;;;;;;;;EAwEN;AAsBM,2DA6KN;AAgBM,yFAiGN;AAMM;;;;;;;;;;;;;GAuDN;AAEM;;;;;;;GAuGN;AAMM,4EA4IN;AAKM,4EAmGN;AAEM,+EAMN;AAEM,4EAyCN;AAEM,iFA0BN"} \ No newline at end of file