Skip to content

Commit

Permalink
Fix: If tagFilter.allowedIds is empty, included should be true.
Browse files Browse the repository at this point in the history
  • Loading branch information
lu4nx committed Jul 22, 2023
1 parent ddbd8a7 commit 79caf25
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions v2/pkg/catalog/loader/filter/tag_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,17 @@ func isIdMatch(tagFilter *TagFilter, templateId string) bool {
if len(tagFilter.excludeIds) == 0 && len(tagFilter.allowedIds) == 0 {
return true
}
included := false
if len(tagFilter.allowedIds) > 0 {
for id := range tagFilter.allowedIds {
match, err := filepath.Match(id, templateId)
if err != nil {
continue
}

if match {
included = true
break
}
included := len(tagFilter.allowedIds) == 0
for id := range tagFilter.allowedIds {
match, err := filepath.Match(id, templateId)
if err != nil {
break
}

if match {
included = true
break
}
}

Expand Down

0 comments on commit 79caf25

Please sign in to comment.