add in a sum for total errors. 0 return 1 when there are any errors, so that it can break our CI pipeline when needed

pull/343/head
ruokai.lai 7 years ago
parent 84f74fa1ee
commit cca55ed764

@ -270,7 +270,10 @@ 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 {
errorTotal := errors.New("total Errors: "+strconv.Itoa(len(vulnerabilities)))
return errorTotal
}
return nil
}

Loading…
Cancel
Save