Skip to content

Commit

Permalink
Prevent downloading duplicate rulesets.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <jortel@redhat.com>
  • Loading branch information
jortel committed Jul 14, 2023
1 parent 086000a commit 5b33071
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,16 @@ func (r *Rules) addFiles() (err error) {
}

//
// addRuleSets adds rulesets.
// addRuleSets adds rulesets and their dependencies.
func (r *Rules) addRuleSets() (err error) {
history := make(map[uint]byte)
var add func(refs []api.Ref, dep bool)
add = func(refs []api.Ref, dep bool) {
for _, ref := range refs {
if _, found := history[ref.ID]; found {
continue
}
history[ref.ID] = 0
var ruleset *api.RuleSet
ruleset, err = addon.RuleSet.Get(ref.ID)
if err != nil {
Expand Down

0 comments on commit 5b33071

Please sign in to comment.