Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support lists of resources in rules #3

Merged
merged 3 commits into from
Jul 15, 2018

Conversation

rmorris1218
Copy link
Contributor

closes #2

assertion.Debugf("using the rule - list of resources")
filteredResources = assertion.FilterResourcesByTypes(resources, rule.Resources, rule.Category)
}
for _, resource := range filteredResources {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend extracting these lines into a new filter function in assertion/util.go. Maybe call it FilterResourcesForRule? Pass the list of Resource objects and the entire Rule object. That would keep this loop code more concise, and groups all the filtering logic together in the same package. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is a cleaner way of doing things.

Copy link
Contributor Author

@rmorris1218 rmorris1218 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is a cleaner way of doing things.

assertion.Debugf("using the rule - list of resources")
filteredResources = assertion.FilterResourcesByTypes(resources, rule.Resources, rule.Category)
}
for _, resource := range filteredResources {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is a cleaner way of doing things.

@lhitchon lhitchon merged commit 3fa32b2 into stelligent:master Jul 15, 2018
kmonihen pushed a commit that referenced this pull request Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple resources for each rule
2 participants