engine, lang: core: Match exported resources properly
I inverted the logic for complex setups and forgot to handle the zero cases. I also didn't notice my loop continue error. This cleans all this up so that we can have proper exported resource matching.
This commit is contained in:
@@ -146,10 +146,8 @@ func GetResources(ctx context.Context, client interfaces.Client, hostname string
|
||||
}
|
||||
|
||||
// TODO: I'd love to avoid this O(N^2) matching if possible...
|
||||
for _, filter := range filters {
|
||||
if err := filter.Match(kind, name, hostnameFrom); err != nil {
|
||||
continue // did not match
|
||||
}
|
||||
if err := engine.MatchFilters(filters, kind, name, hostnameFrom); err != nil {
|
||||
continue // did not match any of these
|
||||
}
|
||||
|
||||
ro := &engine.ResOutput{
|
||||
|
||||
Reference in New Issue
Block a user