-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix docker extract bugs #1513
Fix docker extract bugs #1513
Conversation
90235a7
to
3f6bc32
Compare
|
7a61dc5
to
3d78683
Compare
0a08b74
to
82d88b6
Compare
Signed-off-by: Prabhu Subramanian <[email protected]> Tweaks Signed-off-by: Prabhu Subramanian <[email protected]> Support for fail-on-error for container sbom generation. Env variable to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian <[email protected]> Support for fail-on-error for container sbom generation. Env variable to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian <[email protected]> Support for fail-on-error for container sbom generation. Env variable to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian <[email protected]>
82d88b6
to
e1dcfc2
Compare
… to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian <[email protected]>
@@ -50,32 +51,36 @@ jobs: | |||
path: 'repotests/grafana-operator' | |||
- name: dockertests | |||
run: | | |||
bin/cdxgen.js ubuntu:latest -t docker -o bomresults/bom-ubuntu.json | |||
bin/cdxgen.js ubuntu:latest -t docker -o bomresults/bom-ubuntu.json --fail-on-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running with --fail-on-error
would improve confidence in the tests.
@@ -499,6 +499,9 @@ export function getOSPackages(src) { | |||
} | |||
if (osReleaseData["VERSION_ID"]) { | |||
distro_id = `${distro_id}-${osReleaseData["VERSION_ID"]}`; | |||
if (OS_DISTRO_ALIAS[distro_id]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes some warning for dependency tree in debian images.
@@ -29,6 +29,16 @@ import { DEBUG_MODE, getAllFiles } from "../helpers/utils.js"; | |||
export const isWin = _platform() === "win32"; | |||
export const DOCKER_HUB_REGISTRY = "docker.io"; | |||
|
|||
// Should we extract the tar image in non-strict mode | |||
const NON_STRICT_TAR_EXTRACT = ["true", "1"].includes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is support for untar with strict: false
.
["TAR_ENTRY_INFO", "TAR_ENTRY_INVALID"].includes(err.code) | ||
) { | ||
if ( | ||
err?.header?.path?.includes("{") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a different bug where we attempt to untar textual metadata. This condition handles this edge case.
… to force non-strict tar extraction. Signed-off-by: Prabhu Subramanian <[email protected]>
Fixes #1511