contrib/analyze-local-images: use exit(1) when there are vulnerabilities

This commit is contained in:
Quentin Machu 2017-03-06 22:38:13 -08:00 committed by GitHub
commit e10352864d

View File

@ -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
}