Skip to content

Commit

Permalink
update warning counter
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertent committed Oct 13, 2021
1 parent 85be93b commit a36ce64
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions opapolicy/datastructuresmethods.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (ruleReport *RuleReport) GetNumberOfWarningResources() int {
sum := 0
for i := range ruleReport.RuleResponses {
if ruleReport.RuleResponses[i].GetSingleResultStatus() == "warning" {
sum += 1
sum += len(ruleReport.RuleResponses[i].AlertObject.K8SApiObjects)
}
}
return sum
Expand Down Expand Up @@ -176,9 +176,7 @@ func (ruleReport *RuleReport) GetNumberOfFailedResources() int {
sum := 0
for i := len(ruleReport.RuleResponses) - 1; i >= 0; i-- {
if ruleReport.RuleResponses[i].GetSingleResultStatus() == "failed" {
//if !ruleReport.DeleteIfRedundantResponse(&ruleReport.RuleResponses[i], i) {
sum += len(ruleReport.RuleResponses[i].AlertObject.K8SApiObjects)
//}
}
}
return sum
Expand Down Expand Up @@ -251,7 +249,3 @@ func StringInSlice(strSlice []string, str string) bool {
}
return false
}

// func RemoveResponse(slice []RuleResponse, index int) []RuleResponse {
// return append(slice[:index], slice[index+1:]...)
// }

0 comments on commit a36ce64

Please sign in to comment.