diff --git a/controllers/gcpcluster_controller_test.go b/controllers/gcpcluster_controller_test.go index 95a4e9bb8..41269f8a0 100644 --- a/controllers/gcpcluster_controller_test.go +++ b/controllers/gcpcluster_controller_test.go @@ -55,7 +55,6 @@ var _ = Describe("GCPClusterReconciler", func() { }) Expect(err).NotTo(HaveOccurred()) Expect(result.RequeueAfter).To(BeZero()) - Expect(result.Requeue).To(BeFalse()) }) }) }) diff --git a/controllers/gcpmachine_controller.go b/controllers/gcpmachine_controller.go index 602a9036a..479effc39 100644 --- a/controllers/gcpmachine_controller.go +++ b/controllers/gcpmachine_controller.go @@ -245,7 +245,7 @@ func (r *GCPMachineReconciler) reconcile(ctx context.Context, machineScope *scop default: machineScope.SetFailureReason("UpdateError") machineScope.SetFailureMessage(errors.Errorf("GCPMachine instance state %s is unexpected", instanceState)) - return ctrl.Result{Requeue: true}, nil + return ctrl.Result{RequeueAfter: reconciler.DefaultRetryTime}, nil } } diff --git a/controllers/gcpmachine_controller_test.go b/controllers/gcpmachine_controller_test.go index 7a579b755..d97665fb6 100644 --- a/controllers/gcpmachine_controller_test.go +++ b/controllers/gcpmachine_controller_test.go @@ -47,7 +47,6 @@ var _ = Describe("GCPMachineReconciler", func() { }) Expect(err).NotTo(HaveOccurred()) Expect(result.RequeueAfter).To(BeZero()) - Expect(result.Requeue).To(BeFalse()) }) }) }) diff --git a/exp/controllers/gcpmanagedcontrolplane_controller.go b/exp/controllers/gcpmanagedcontrolplane_controller.go index f751031b9..e346b04ef 100644 --- a/exp/controllers/gcpmanagedcontrolplane_controller.go +++ b/exp/controllers/gcpmanagedcontrolplane_controller.go @@ -96,7 +96,7 @@ func (r *GCPManagedControlPlaneReconciler) Reconcile(ctx context.Context, req ct if apierrors.IsNotFound(err) { return ctrl.Result{}, nil } - return ctrl.Result{Requeue: true}, nil + return ctrl.Result{}, fmt.Errorf("getting GCPManagedControlPlane: %w", err) } // Get the cluster @@ -181,10 +181,6 @@ func (r *GCPManagedControlPlaneReconciler) reconcile(ctx context.Context, manage log.V(4).Info("Reconciler requested requeueAfter", "reconciler", name, "after", res.RequeueAfter) return res, nil } - if res.Requeue { - log.V(4).Info("Reconciler requested requeue", "reconciler", name) - return res, nil - } } return ctrl.Result{}, nil @@ -209,10 +205,6 @@ func (r *GCPManagedControlPlaneReconciler) reconcileDelete(ctx context.Context, log.V(4).Info("Reconciler requested requeueAfter", "reconciler", name, "after", res.RequeueAfter) return res, nil } - if res.Requeue { - log.V(4).Info("Reconciler requested requeue", "reconciler", name) - return res, nil - } } if managedControlPlaneScope.GCPManagedControlPlane != nil && diff --git a/exp/controllers/gcpmanagedmachinepool_controller.go b/exp/controllers/gcpmanagedmachinepool_controller.go index 1a90e33ca..bac3608b2 100644 --- a/exp/controllers/gcpmanagedmachinepool_controller.go +++ b/exp/controllers/gcpmanagedmachinepool_controller.go @@ -235,7 +235,7 @@ func (r *GCPManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctr if apierrors.IsNotFound(err) { return ctrl.Result{}, nil } - return ctrl.Result{Requeue: true}, nil + return ctrl.Result{}, fmt.Errorf("getting GCPManagedMachinePool: %w", err) } // Get the machine pool @@ -349,10 +349,6 @@ func (r *GCPManagedMachinePoolReconciler) reconcile(ctx context.Context, managed log.V(4).Info("Reconciler requested requeueAfter", "reconciler", name, "after", res.RequeueAfter) return res, nil } - if res.Requeue { - log.V(4).Info("Reconciler requested requeue", "reconciler", name) - return res, nil - } } return ctrl.Result{}, nil @@ -385,10 +381,6 @@ func (r *GCPManagedMachinePoolReconciler) reconcileDelete(ctx context.Context, m log.V(4).Info("Reconciler requested requeueAfter", "reconciler", name, "after", res.RequeueAfter) return res, nil } - if res.Requeue { - log.V(4).Info("Reconciler requested requeue", "reconciler", name) - return res, nil - } } if conditions.Get(managedMachinePoolScope.GCPManagedMachinePool, infrav1exp.GKEMachinePoolDeletingCondition).Reason == infrav1exp.GKEMachinePoolDeletedReason {