-
Notifications
You must be signed in to change notification settings - Fork 114
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
nodes: filtering by multiple tags #377
Conversation
Signed-off-by: Victoria Jeffrey <[email protected]>
Signed-off-by: Victoria Jeffrey <[email protected]>
Signed-off-by: Victoria Jeffrey <[email protected]>
if len(oRConditionsForTags) == 0 { | ||
whereFilter = fmt.Sprintf("WHERE (%s)", strings.Join(conditions, " AND ")) | ||
} else { | ||
if len(conditions) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this too messy? is there a cleaner way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is getting a bit convoluted with special cases. I think you could simplify somewhat by separating all the tag handling from the other filters. If you moved all the tag filter handling first, that stuff could be OR
ed together and added to the conditions
as just another element, since those all get AND
ed together at the end.
Hopefully that made sense, I was trying to avoid just writing a bunch of pseudocode.
Signed-off-by: Victoria Jeffrey <[email protected]>
1d3def8
to
234a876
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, very clear and concise. 👍
🔩 Description
fixes #370
When creating a scan job, and filtering by tag values for the Automate node manager, we are currently unable to filter by multiple tags.
👍 Definition of Done
Able to filter nodes by multiple tags (Automate nodemanager)
👟 Demo Script / Repro Steps
rebuild nodemanager
create some nodes with different tags
create a scan job filtering by those tags