@@ -21,7 +21,6 @@ import (
2121 "encoding/base64"
2222 "errors"
2323 "fmt"
24- "reflect"
2524 "time"
2625
2726 "github.com/go-logr/logr"
@@ -45,9 +44,7 @@ import (
4544 "sigs.k8s.io/controller-runtime/pkg/client"
4645 "sigs.k8s.io/controller-runtime/pkg/controller"
4746 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
48- "sigs.k8s.io/controller-runtime/pkg/event"
4947 "sigs.k8s.io/controller-runtime/pkg/handler"
50- "sigs.k8s.io/controller-runtime/pkg/predicate"
5148 "sigs.k8s.io/controller-runtime/pkg/reconcile"
5249
5350 infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1"
@@ -212,23 +209,7 @@ func patchMachine(ctx context.Context, patchHelper *patch.Helper, openStackMachi
212209func (r * OpenStackMachineReconciler ) SetupWithManager (ctx context.Context , mgr ctrl.Manager , options controller.Options ) error {
213210 return ctrl .NewControllerManagedBy (mgr ).
214211 WithOptions (options ).
215- For (
216- & infrav1.OpenStackMachine {},
217- builder .WithPredicates (
218- predicate.Funcs {
219- // Avoid reconciling if the event triggering the reconciliation is related to incremental status updates
220- UpdateFunc : func (e event.UpdateEvent ) bool {
221- oldMachine := e .ObjectOld .(* infrav1.OpenStackMachine ).DeepCopy ()
222- newMachine := e .ObjectNew .(* infrav1.OpenStackMachine ).DeepCopy ()
223- oldMachine .Status = infrav1.OpenStackMachineStatus {}
224- newMachine .Status = infrav1.OpenStackMachineStatus {}
225- oldMachine .ObjectMeta .ResourceVersion = ""
226- newMachine .ObjectMeta .ResourceVersion = ""
227- return ! reflect .DeepEqual (oldMachine , newMachine )
228- },
229- },
230- ),
231- ).
212+ For (& infrav1.OpenStackMachine {}).
232213 Watches (
233214 & clusterv1.Machine {},
234215 handler .EnqueueRequestsFromMapFunc (util .MachineToInfrastructureMapFunc (infrav1 .GroupVersion .WithKind ("OpenStackMachine" ))),
0 commit comments