Skip to content

Commit

Permalink
Introduce a short wait after scheduling a pod to allow the watch even…
Browse files Browse the repository at this point in the history
…t to propagate to avoid unnecessary retries
  • Loading branch information
ellistarn committed Nov 24, 2021
1 parent fdb0b0f commit a21edf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controllers/scheduling/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package scheduling
import (
"context"
"fmt"
"time"

"github.com/aws/karpenter/pkg/controllers/provisioning"
"github.com/aws/karpenter/pkg/utils/pod"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a21edf8

Please sign in to comment.