Skip to content

Commit

Permalink
update image scan snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
hogo6002 committed Jan 23, 2025
1 parent 143cbf3 commit c5edccd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/osv-scanner/__snapshots__/main_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,7 @@ failed to pull container image: failed to run docker command
Checking if docker image ("alpine:3.18.9") exists locally...
Saving docker image ("alpine:3.18.9") to temporary file...
Scanning image "alpine:3.18.9"

Container Scanning Result (Alpine Linux v3.18):
Total 1 packages affected by 1 vulnerabilities (0 Critical, 0 High, 0 Medium, 0 Low, 1 Unknown) from 1 ecosystems.
1 vulnerabilities have fixes available.
Expand All @@ -1163,8 +1164,8 @@ Alpine:v3.18
| openssl | 3.1.7-r0 | Fix Available | 1 | # 0 Layer | alpine |
+---------+-------------------+---------------+------------+------------------+---------------+

For the most comprehensive scan results, we recommend using the HTML output: `osv-scanner --format html --output results.html`.
You can also view the full vulnerability list in your terminal with: `osv-scanner --format vertical`.
For the most comprehensive scan results, we recommend using the HTML output: `osv-scanner scan image --serve <image_name>`.
You can also view the full vulnerability list in your terminal with: `osv-scanner scan image --format vertical <image_name>`.

---

Expand Down
2 changes: 2 additions & 0 deletions internal/output/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func tableBuilder(outputTable table.Writer, vulnResult *models.VulnerabilityResu
}

func printContainerScanningResult(result Result, outputWriter io.Writer, terminalWidth int) {
// Add a newline to separate results from logs.
fmt.Fprintln(outputWriter)
fmt.Fprintf(outputWriter, "Container Scanning Result (%s):\n", result.ImageInfo.OS)
summary := fmt.Sprintf(
"Total %[1]d packages affected by %[2]d vulnerabilities (%[3]d Critical, %[4]d High, %[5]d Medium, %[6]d Low, %[7]d Unknown) from %[8]d ecosystems.\n"+
Expand Down

0 comments on commit c5edccd

Please sign in to comment.