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

event predicates logic optimization #1013

Closed
cuisongliu opened this issue Jun 22, 2020 · 4 comments
Closed

event predicates logic optimization #1013

cuisongliu opened this issue Jun 22, 2020 · 4 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Milestone

Comments

@cuisongliu
Copy link

for _, p := range e.Predicates {

this code design is “and” logic。 but I think "or" logic is better?

       var flag bool
       for _, p := range e.Predicates {
		if p.Create(c) {
			flag = true
                        break
		} 
	}
       
        if flag{
             // Invoke create handler
	     e.EventHandler.Create(c, e.Queue)
        }
  • all false result is false;
  • has one true result is true
@cuisongliu
Copy link
Author

/assign

@cuisongliu
Copy link
Author

cuisongliu commented Jun 22, 2020

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 22, 2020
@vincepri
Copy link
Member

Can we rely on the Or functionality that we now have in #1043

/milestone Next
/priority awaiting-more-evidence

@k8s-ci-robot k8s-ci-robot added this to the Next milestone Jul 22, 2020
@k8s-ci-robot k8s-ci-robot added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Jul 22, 2020
@cuisongliu
Copy link
Author

yes, I want this logic. thank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

3 participants