diff --git a/pkg/controllerutils/predicate/predicate.go b/pkg/controllerutils/predicate/predicate.go index 3281ae2352d..13dfdaedbb0 100644 --- a/pkg/controllerutils/predicate/predicate.go +++ b/pkg/controllerutils/predicate/predicate.go @@ -45,24 +45,6 @@ func HasName(name string) predicate.Predicate { }) } -// Not inverts the passed predicate. -func Not(p predicate.Predicate) predicate.Predicate { - return predicate.Funcs{ - CreateFunc: func(event event.CreateEvent) bool { - return !p.Create(event) - }, - UpdateFunc: func(event event.UpdateEvent) bool { - return !p.Update(event) - }, - GenericFunc: func(event event.GenericEvent) bool { - return !p.Generic(event) - }, - DeleteFunc: func(event event.DeleteEvent) bool { - return !p.Delete(event) - }, - } -} - // EventType is an alias for byte. type EventType byte diff --git a/pkg/controllerutils/predicate/predicate_test.go b/pkg/controllerutils/predicate/predicate_test.go index 50e20d0a9f1..c5cc7155884 100644 --- a/pkg/controllerutils/predicate/predicate_test.go +++ b/pkg/controllerutils/predicate/predicate_test.go @@ -149,30 +149,6 @@ var _ = Describe("Predicate", func() { }) }) - Describe("#Not", func() { - It("should invert predicate", func() { - predicate := Not(predicate.Funcs{ - CreateFunc: func(_ event.CreateEvent) bool { - return true - }, - UpdateFunc: func(_ event.UpdateEvent) bool { - return true - }, - GenericFunc: func(_ event.GenericEvent) bool { - return true - }, - DeleteFunc: func(_ event.DeleteEvent) bool { - return true - }, - }) - - gomega.Expect(predicate.Create(event.CreateEvent{})).To(gomega.BeFalse()) - gomega.Expect(predicate.Update(event.UpdateEvent{})).To(gomega.BeFalse()) - gomega.Expect(predicate.Delete(event.DeleteEvent{})).To(gomega.BeFalse()) - gomega.Expect(predicate.Generic(event.GenericEvent{})).To(gomega.BeFalse()) - }) - }) - DescribeTable("#ForEventTypes", func(events []EventType, createMatcher, updateMatcher, deleteMatcher, genericMatcher gomegatypes.GomegaMatcher) { p := ForEventTypes(events...) diff --git a/pkg/scheduler/controller/shoot/add.go b/pkg/scheduler/controller/shoot/add.go index 9443e7ccbe2..32452b25378 100644 --- a/pkg/scheduler/controller/shoot/add.go +++ b/pkg/scheduler/controller/shoot/add.go @@ -42,7 +42,7 @@ func (r *Reconciler) AddToManager(mgr manager.Manager) error { Named(ControllerName). For(&gardencorev1beta1.Shoot{}, builder.WithPredicates( r.ShootPredicate(), - predicateutils.Not(predicateutils.IsDeleting()), + predicate.Not(predicateutils.IsDeleting()), )). WithOptions(controller.Options{ MaxConcurrentReconciles: r.Config.ConcurrentSyncs,