Skip to content

Commit

Permalink
Refactor common code
Browse files Browse the repository at this point in the history
  • Loading branch information
shaswa committed Dec 16, 2020
1 parent 6b7ccda commit 3a2fb35
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/config/exemptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ func (conf Configuration) IsActionable(ruleID, namespace, controllerName string)
continue
}

checkIfActionable := false
for _, rule := range example.Rules {
if rule != ruleID {
continue
}

for _, controller := range example.ControllerNames {
if strings.HasPrefix(controllerName, controller) {
return false
}
}
checkIfActionable = true
break
}
if len(example.Rules) == 0 {

if len(example.Rules) == 0 || checkIfActionable {
for _, controller := range example.ControllerNames {
if strings.HasPrefix(controllerName, controller) {
return false
Expand Down

0 comments on commit 3a2fb35

Please sign in to comment.