这是indexloc提供的服务,不要输入任何密码
Skip to content

Support custom filter for pod event handlers #866

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

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

cpuguy83
Copy link
Contributor

This allows users who have a shared informer that is not filtering on
node name to supply a filter for event handlers to ensure events do not
fire for pods not scheduled to the node.

@cpuguy83 cpuguy83 requested a review from sargun July 28, 2020 22:12
@cpuguy83 cpuguy83 force-pushed the add_event_filter_support branch from 2cbf57e to 70acfd8 Compare July 28, 2020 22:13
Copy link
Contributor

@sargun sargun left a comment

Choose a reason for hiding this comment

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

I have some suggestions for improvements, but none of the are blocking merging of the PR.

@cpuguy83 cpuguy83 force-pushed the add_event_filter_support branch 2 times, most recently from f55e6cf to 5d4563d Compare July 30, 2020 22:13
@cpuguy83
Copy link
Contributor Author

@sargun Can you give this another glance?

Copy link
Contributor

@sargun sargun left a comment

Choose a reason for hiding this comment

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

I still think it'd be nice if we passed some ctx to PodEventFilterFunc --

func(obj interface{}) bool {
				p, ok := obj.(*corev1.Pod)
				if !ok {
					return false
				}
                                 // This will be a random ctx, but at least it can be used for logging and stuff. 
				return pc.podEventFilterFunc(ctx, p)
			},

@cpuguy83 cpuguy83 force-pushed the add_event_filter_support branch from 5d4563d to 7257c6b Compare July 31, 2020 00:09
This allows users who have a shared informer that is *not* filtering on
node name to supply a filter for event handlers to ensure events do not
fire for pods not scheduled to the node.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83 cpuguy83 force-pushed the add_event_filter_support branch from 7257c6b to c0296b9 Compare July 31, 2020 00:17
@cpuguy83
Copy link
Contributor Author

Updated to add context.Context support.

@cpuguy83 cpuguy83 merged commit 851f5ab into virtual-kubelet:master Jul 31, 2020
@cpuguy83 cpuguy83 deleted the add_event_filter_support branch July 31, 2020 16:30
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.

2 participants