Skip to content

Commit

Permalink
issue discovered by redis:alpine image
Browse files Browse the repository at this point in the history
Signed-off-by: Raziel Cohen <rcohen@armosec.io>
  • Loading branch information
Raziel Cohen committed May 3, 2023
1 parent 58a2275 commit c89d60c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/sbom/v1/sbom_spdx_storage_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
sourceInfoRebar = "acquired package info from rebar3 or mix manifest file"
sourceInfoLinuxKernel = "acquired package info from linux kernel archive"
sourceInfoLinuxKernelModule = "acquired package info from linux kernel module files"
sourceInfoDefault = "acquired package info from the following paths"
)

var spdxDataDirPath string
Expand Down Expand Up @@ -75,7 +76,7 @@ func createSBOMDir() {

func init() {
createSBOMDir()
sourceInfoPrefixData := []string{sourceInfoDotnet, sourceInfoNodeModule, sourceInfoPythonPackage, sourceInfoJava, sourceInfoGemFile, sourceInfoGoModule, sourceInfoRustCargo, sourceInfoPHPComposer, sourceInfoCabal, sourceInfoRebar, sourceInfoLinuxKernel, sourceInfoLinuxKernelModule}
sourceInfoPrefixData := []string{sourceInfoDotnet, sourceInfoNodeModule, sourceInfoPythonPackage, sourceInfoJava, sourceInfoGemFile, sourceInfoGoModule, sourceInfoRustCargo, sourceInfoPHPComposer, sourceInfoCabal, sourceInfoRebar, sourceInfoLinuxKernel, sourceInfoLinuxKernelModule, sourceInfoDefault}
sourceInfoRequiredPrefix = append(sourceInfoRequiredPrefix,sourceInfoPrefixData...)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sbom/v1/sbom_spdx_storage_format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func TestParsedFilesBySourceInfo(t *testing.T) {
}

func TestParsedFilesBySourceInfoFiltered(t *testing.T) {
shouldBeSourcesInfo := []string{"acquired package info from dotnet project assets file: 123, 456", "acquired package info from installed node module manifest file: 123, 456", "acquired package info from installed python package manifest file: 123, 456", "acquired package info from installed java archive: 123, 456", "acquired package info from installed gem metadata file: 123, 456", "acquired package info from go module information: 123, 456", "acquired package info from rust cargo manifest: 123, 456", "acquired package info from PHP composer manifest: 123, 456", "acquired package info from cabal or stack manifest files: 123, 456", "acquired package info from rebar3 or mix manifest files: 123, 456", "acquired package info from linux kernel archive: 123, 456", "acquired package info from linux kernel module files: 123, 456"}
shouldBeSourcesInfo := []string{"acquired package info from dotnet project assets file: 123, 456", "acquired package info from installed node module manifest file: 123, 456", "acquired package info from installed python package manifest file: 123, 456", "acquired package info from installed java archive: 123, 456", "acquired package info from installed gem metadata file: 123, 456", "acquired package info from go module information: 123, 456", "acquired package info from rust cargo manifest: 123, 456", "acquired package info from PHP composer manifest: 123, 456", "acquired package info from cabal or stack manifest files: 123, 456", "acquired package info from rebar3 or mix manifest files: 123, 456", "acquired package info from linux kernel archive: 123, 456", "acquired package info from linux kernel module files: 123, 456", "acquired package info from the following paths: 123, 456"}
for i := range shouldBeSourcesInfo {
list := parsedFilesBySourceInfo(shouldBeSourcesInfo[i])
if len(list) != 2 {
Expand Down

0 comments on commit c89d60c

Please sign in to comment.