Skip to content

Commit

Permalink
Merge pull request #509 from openinfradev/add_debug
Browse files Browse the repository at this point in the history
trivial. fix error for policyViolationTop5
  • Loading branch information
ktkfree authored May 23, 2024
2 parents a723173 + f4e3a1f commit bff70db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/usecase/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,10 @@ func (u *DashboardUsecase) GetPolicyViolationTop5(ctx context.Context, organizat
warnCount := 0
dryrunCount := 0
for _, result := range pvcm.Data.Result {
if result.Value == nil || len(result.Value) <= 1 {
continue
}

switch policy := result.Metric.ViolationEnforcement; policy {
case "":
denyCount, _ = strconv.Atoi(result.Value[1].(string))
Expand Down

0 comments on commit bff70db

Please sign in to comment.