Skip to content

Commit

Permalink
added container in metadata for dockerimages
Browse files Browse the repository at this point in the history
  • Loading branch information
ragavareddychalapala committed Aug 27, 2024
1 parent dc82754 commit afcf4aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/LCT.PackageIdentifier.UTest/CycloneBomProcessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public void SetMetadataInComparisonBOM_GivenBOMWithEmptyMetadata_FillsInMetadata
};
CommonAppSettings appSettings = new CommonAppSettings()
{
CaVersion = "1.2.3"
CaVersion = "1.2.3",
ProjectType="NPM",
};
CatoolInfo caToolInformation = new CatoolInfo() { CatoolVersion = "6.0.0", CatoolRunningLocation="" };
//Act
Expand Down Expand Up @@ -73,6 +74,7 @@ public void SetMetadataInComparisonBOM_GivenBOMWithMetadata_AddsNewMetadataInfoI
{
CaVersion = "1.2.3",
SW360ProjectName = "Test",
ProjectType = "NPM",
};

Tool tools = new Tool()
Expand Down
7 changes: 4 additions & 3 deletions src/LCT.PackageIdentifier/CycloneBomProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using LCT.Common.Model;
using log4net;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace LCT.PackageIdentifier
Expand All @@ -25,7 +26,7 @@ public static Bom SetMetadataInComparisonBOM(Bom bom,
ProjectReleases projectReleases,
CatoolInfo caToolInformation)
{
Logger.Debug("Starting to add metadata info into the BOM");
Logger.Debug("Starting to add metadata info into the BOM");
Metadata metadata = new Metadata
{
Tools = new List<Tool>(),
Expand All @@ -38,7 +39,7 @@ public static Bom SetMetadataInComparisonBOM(Bom bom,
{
Name = appSettings.SW360ProjectName,
Version = projectReleases.Version,
Type = Component.Classification.Application
Type = appSettings.ProjectType.ToUpperInvariant().Contains("DEBIAN",System.StringComparison.OrdinalIgnoreCase) || appSettings.ProjectType.ToUpperInvariant().Contains("ALPINE", System.StringComparison.OrdinalIgnoreCase) ? Component.Classification.Container : Component.Classification.Application
};
metadata.Component = component;

Expand All @@ -51,7 +52,7 @@ public static Bom SetMetadataInComparisonBOM(Bom bom,

bom.Metadata = metadata;
return bom;
}
}

public static void SetMetaDataToolsValues(Metadata metadata, CatoolInfo caToolInformation)
{
Expand Down

0 comments on commit afcf4aa

Please sign in to comment.