mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-13 01:38:32 -04:00
update
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
81851b276b
commit
7b1564a6a1
5
vulns.go
5
vulns.go
|
@ -87,6 +87,11 @@ func (cmd *vulnsCommand) Run(ctx context.Context, args []string) error {
|
|||
}
|
||||
}
|
||||
|
||||
if len(report.VulnsBySeverity) < 1 {
|
||||
fmt.Println("No vulnerabilies found.")
|
||||
return nil
|
||||
}
|
||||
|
||||
// Print summary and count.
|
||||
for sev, vulns := range report.VulnsBySeverity {
|
||||
fmt.Printf("%s: %d\n", sev, len(vulns))
|
||||
|
|
|
@ -12,7 +12,8 @@ func TestVulns(t *testing.T) {
|
|||
t.Fatalf("output: %s, error: %v", out, err)
|
||||
}
|
||||
|
||||
expected := `clair.clair resp.Status=200 OK`
|
||||
expected := `clair.clair resp.Status=200 OK
|
||||
No vulnerabilies found.`
|
||||
if !strings.HasSuffix(strings.TrimSpace(out), expected) {
|
||||
t.Fatalf("expected: %s\ngot: %s", expected, out)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue