Skip to content

Commit

Permalink
Change table order and remove duplicate print
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Sep 27, 2023
1 parent a412623 commit 93617a4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions xray/commands/scan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,6 @@ func (scanCmd *ScanCommand) binaryScan() (extendedScanResults *xrutils.ExtendedS
scanErrors = appendErrorSlice(scanErrors, indexedFileProducerErrors)
extendedScanResults = &xrutils.ExtendedScanResults{XrayResults: flatResults}

if err = xrutils.NewResultsWriter(extendedScanResults).
SetOutputFormat(scanCmd.outputFormat).
SetIncludeVulnerabilities(scanCmd.includeVulnerabilities).
SetIncludeLicenses(scanCmd.includeLicenses).
SetPrintExtendedTable(scanCmd.printExtendedTable).
SetIsMultipleRootProject(true).
SetScanType(services.Binary).
PrintScanResults(); err != nil {
return
}

// If includeVulnerabilities is false it means that context was provided, so we need to check for build violations.
// If user provided --fail=false, don't fail the build.
if scanCmd.fail && !scanCmd.includeVulnerabilities {
Expand Down
2 changes: 1 addition & 1 deletion xray/formats/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func ConvertToVulnerabilityDockerScanTableRow(rows []VulnerabilityOrViolationRow
ImpactedPackageType: rows[i].ImpactedDependencyType,
fixedVersions: fixedVersionsFallback(rows[i].FixedVersions),
cves: convertToShortCveTableRow(rows[i].Cves),
dockerfileCommand: dockerCommand.Command,
dockerCommand: dockerCommand.Command,
dockerfileLine: strings.Join(dockerCommand.Line, ","),
})
}
Expand Down
2 changes: 1 addition & 1 deletion xray/formats/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ type vulnerabilityDockerScanTableRow struct {
severity string `col-name:"Severity"`
// For sorting
severityNumValue int
dockerCommand string `col-name:"Command\n"`
impactedPackageName string `col-name:"Impacted\nPackage\nName"`
impactedPackageVersion string `col-name:"Impacted\nPackage\nVersion"`
fixedVersions string `col-name:"Fixed\nVersions"`
ImpactedPackageType string `col-name:"Type"`
dockerfileLine string `col-name:"Dockerfile\nLine Number\n" extended:"true"`
dockerfileCommand string `col-name:"Dockerfile\nCommand\n" `
cves []cveShortTableRow `embed-table:"true"`
}

Expand Down

0 comments on commit 93617a4

Please sign in to comment.