Skip to content

Commit

Permalink
Delay before requeuing child deletion checks
Browse files Browse the repository at this point in the history
  • Loading branch information
liztio committed Jul 23, 2019
1 parent f8ce245 commit 48d58a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cluster
import (
"context"
"fmt"
"time"

"github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -53,6 +54,10 @@ func AddWithActuator(mgr manager.Manager, actuator Actuator) error {
return add(mgr, reconciler)
}

const (
deleteRequeueAfter = 5 * time.Second
)

// newReconciler returns a new reconcile.Reconciler
func newReconciler(mgr manager.Manager, actuator Actuator) (reconcile.Reconciler, error) {
cclient, err := v1alpha1.NewForConfig(mgr.GetConfig())
Expand Down Expand Up @@ -169,7 +174,7 @@ func (r *ReconcileCluster) Reconcile(request reconcile.Request) (reconcile.Resul
}
}

return reconcile.Result{Requeue: true}, nil
return reconcile.Result{Requeue: true, RequeueAfter: deleteRequeueAfter}, nil
}

klog.Infof("Reconciling cluster object %v triggers delete.", name)
Expand Down

0 comments on commit 48d58a5

Please sign in to comment.