@cyclonedx/cdxgen 10.0.5 → 10.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +19 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3791,7 +3791,10 @@ export const createContainerSpecLikeBom = async (path, options) => {
3791
3791
  if (img.image) {
3792
3792
  if (doneimages.includes(img.image)) {
3793
3793
  if (DEBUG_MODE) {
3794
- console.log("Skipping", img.image);
3794
+ console.log(
3795
+ "Skipping image as it's already been processed",
3796
+ img.image
3797
+ );
3795
3798
  }
3796
3799
 
3797
3800
  skippedImageSrcs.push({ image: img.image, src: f });
@@ -3814,8 +3817,21 @@ export const createContainerSpecLikeBom = async (path, options) => {
3814
3817
  type: "container"
3815
3818
  };
3816
3819
  if (imageObj.registry) {
3817
- pkg["qualifiers"]["repository_url"] =
3818
- `${imageObj.registry}/${imageObj.repo}`;
3820
+ // Skip adding repository_url if the registry or repo contains variables.
3821
+ if (
3822
+ imageObj.registry.includes("${") ||
3823
+ imageObj.repo.includes("${")
3824
+ ) {
3825
+ if (DEBUG_MODE) {
3826
+ console.warn(
3827
+ "Skipping adding repository_url qualifier as it contains variables, which are not yet supported",
3828
+ img.image
3829
+ );
3830
+ }
3831
+ } else {
3832
+ pkg["qualifiers"]["repository_url"] =
3833
+ `${imageObj.registry}/${imageObj.repo}`;
3834
+ }
3819
3835
  }
3820
3836
  if (imageObj.platform) {
3821
3837
  pkg["qualifiers"]["platform"] = imageObj.platform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclonedx/cdxgen",
3
- "version": "10.0.5",
3
+ "version": "10.0.6",
4
4
  "description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
5
5
  "homepage": "http://github.com/cyclonedx/cdxgen",
6
6
  "author": "Prabhu Subramanian <prabhu@appthreat.com>",