Skip to content

Commit 098c911

Browse files
committed
Omit unnecessary Requeue: true when returning an error from the reconcile loop
1 parent d4894ad commit 098c911

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

controllers/configmap_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ func (r *ConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
7474
serviceCA, err := certs.GetServiceCA(ctx, r.Client, l, r.CANamespace)
7575
if err != nil {
7676
l.Info("Service CA not ready yet, requeuing request")
77-
return ctrl.Result{
78-
Requeue: true,
79-
}, err
77+
return ctrl.Result{}, err
8078
}
81-
8279
cmLabels := cm.Labels
8380
if cmLabels == nil {
8481
// nothing to do, exit

controllers/service_controller.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
9191
_, err = certs.GetServiceCA(ctx, r.Client, l, r.CANamespace)
9292
if err != nil {
9393
l.Info("Service CA not ready yet, requeuing request")
94-
return ctrl.Result{
95-
Requeue: true,
96-
}, err
94+
return ctrl.Result{}, err
9795
}
9896

9997
l.V(1).Info("Reconciling certificate for service")

controllers/service_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestSvcController_Reconcile(t *testing.T) {
6969
&labeledService,
7070
},
7171
err: fmt.Errorf("CA certificate not yet ready"),
72-
res: ctrl.Result{Requeue: true},
72+
res: ctrl.Result{},
7373
},
7474
"LabeledService_CAReady": {
7575
objects: append(

0 commit comments

Comments
 (0)