From a21edf8a1a7a9d062896c6ac1484acb7da08ff70 Mon Sep 17 00:00:00 2001 From: Ellis Tarn Date: Wed, 24 Nov 2021 15:39:46 -0800 Subject: [PATCH] Introduce a short wait after scheduling a pod to allow the watch event to propagate to avoid unnecessary retries --- pkg/controllers/scheduling/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/scheduling/controller.go b/pkg/controllers/scheduling/controller.go index 581b33f0720e..d9b445bdc910 100644 --- a/pkg/controllers/scheduling/controller.go +++ b/pkg/controllers/scheduling/controller.go @@ -17,6 +17,7 @@ package scheduling import ( "context" "fmt" + "time" "github.com/aws/karpenter/pkg/controllers/provisioning" "github.com/aws/karpenter/pkg/utils/pod" @@ -70,7 +71,7 @@ func (c *Controller) Reconcile(ctx context.Context, req reconcile.Request) (reco if err := c.Schedule(ctx, pod); err != nil { logging.FromContext(ctx).Errorf("Failed to schedule, %s", err.Error()) } - return reconcile.Result{Requeue: true}, nil + return reconcile.Result{RequeueAfter: time.Second * 5}, nil } func (c *Controller) Schedule(ctx context.Context, pod *v1.Pod) error {