contrib/analyze-local-images: use exit(1) when there are vulnerabilities
This commit is contained in:
commit
e10352864d
@ -270,7 +270,9 @@ func AnalyzeLocalImage(imageName string, minSeverity types.Priority, endpoint, m
|
||||
fmt.Printf("%s No vulnerabilities were detected in your image\n", color.GreenString("Success!"))
|
||||
} else if !hasVisibleVulnerabilities {
|
||||
fmt.Printf("%s No vulnerabilities matching the minimum severity level were detected in your image\n", color.YellowString("NOTE:"))
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("A total of %d vulnerabilities have been detected in your image", len(vulnerabilities))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user