-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Refactoring code for label-based filtering for Ansible Operators #5086
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
Refactoring code for label-based filtering for Ansible Operators #5086
Conversation
Signed-off-by: Venkat Ramaraju <[email protected]>
65bfa7e
to
c8bb5f3
Compare
Signed-off-by: Venkat Ramaraju <[email protected]>
return r.Selector.Matches(labels.Set(eventLabels)) | ||
} | ||
|
||
func NewResourceFilterPredicate(s metav1.LabelSelector) (predicate.Predicate, error) { |
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.
While the new LabelSelectorPredicate
does not have the exact same implementation as this does, it seems like a safe change because labels should only be update-able from an update event.
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.
/lgtm
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.
/lgtm
…rator-framework#5086) Signed-off-by: Venkat Ramaraju <[email protected]>
…rator-framework#5086) Signed-off-by: Venkat Ramaraju <[email protected]> Signed-off-by: Thierry Wasylczenko <[email protected]>
Fixes #4949 |
Description of the change:
Removed some of the code from #3275 and instead obtained the same functionality from controller runtime.
Motivation for the change:
When this was originally created in Operator SDK, controller-runtime did not support this feature. Now that it's a part of controller-runtime (from this PR), we leverage it in SDK and remove the extra code.
Notes
internal/ansible
. The predicate folder only containspredicate.go
. The code frompredicate.go
is present upstream.