Skip to content

Commit

Permalink
reports 0 vulnerabilies in case the check is successful (#312)
Browse files Browse the repository at this point in the history
* reports 0 vulnerabilies in case the check is successful
* updates docs
  • Loading branch information
dani-santos-code authored Oct 26, 2020
1 parent e429a88 commit c730a9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ $ kubeaudit all -f "internal/test/fixtures/all_resources/deployment-apps-v1.yml"
...
```

If no errors with a given minimum severity are found, the following is returned:

```shell
All checks completed. 0 high-risk vulnerabilities found
```

#### Autofix

Manifest mode also supports autofixing all security issues using the `autofix` command:
Expand Down
4 changes: 4 additions & 0 deletions printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func (p *Printer) PrintReport(report *Report) {
}

func (p *Printer) prettyPrintReport(report *Report) {
if len(report.ResultsWithMinSeverity(p.minSeverity)) < 1 {
p.printColor(color.GreenColor, "All checks completed. 0 high-risk vulnerabilities found\n")
}

for _, workloadResult := range report.ResultsWithMinSeverity(p.minSeverity) {
resource := workloadResult.GetResource().Object()
objectMeta := k8s.GetObjectMeta(resource)
Expand Down

0 comments on commit c730a9d

Please sign in to comment.