@@ -21,7 +21,6 @@ import (
21
21
"encoding/base64"
22
22
"errors"
23
23
"fmt"
24
- "reflect"
25
24
"time"
26
25
27
26
"github.com/go-logr/logr"
@@ -45,9 +44,7 @@ import (
45
44
"sigs.k8s.io/controller-runtime/pkg/client"
46
45
"sigs.k8s.io/controller-runtime/pkg/controller"
47
46
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
48
- "sigs.k8s.io/controller-runtime/pkg/event"
49
47
"sigs.k8s.io/controller-runtime/pkg/handler"
50
- "sigs.k8s.io/controller-runtime/pkg/predicate"
51
48
"sigs.k8s.io/controller-runtime/pkg/reconcile"
52
49
53
50
infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1"
@@ -212,23 +209,7 @@ func patchMachine(ctx context.Context, patchHelper *patch.Helper, openStackMachi
212
209
func (r * OpenStackMachineReconciler ) SetupWithManager (ctx context.Context , mgr ctrl.Manager , options controller.Options ) error {
213
210
return ctrl .NewControllerManagedBy (mgr ).
214
211
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 {}).
232
213
Watches (
233
214
& clusterv1.Machine {},
234
215
handler .EnqueueRequestsFromMapFunc (util .MachineToInfrastructureMapFunc (infrav1 .GroupVersion .WithKind ("OpenStackMachine" ))),
0 commit comments