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

Fixed calculation of reconcile event handling for PipePods #1322

Merged
merged 2 commits into from
Feb 3, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/controller/instance/instance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ func (r *Reconciler) SetupWithManager(
resPredicate := predicate.Funcs{
CreateFunc: func(event.CreateEvent) bool { return true },
DeleteFunc: func(e event.DeleteEvent) bool {
return e.Meta.GetAnnotations() != nil &&
funk.Contains(e.Meta.GetAnnotations(), task.PipePodAnnotation)
return !isForPipePod(e)
},
UpdateFunc: func(event.UpdateEvent) bool { return true },
GenericFunc: func(event.GenericEvent) bool { return true },
Expand All @@ -123,6 +122,10 @@ func (r *Reconciler) SetupWithManager(
Complete(r)
}

func isForPipePod(e event.DeleteEvent) bool {
return e.Meta.GetAnnotations() != nil && funk.Contains(e.Meta.GetAnnotations(), task.PipePodAnnotation)
}

// Reconcile is the main controller method that gets called every time something about the instance changes
//
// +-------------------------------+
Expand Down