Skip to content

Commit

Permalink
PackageVariant: Use the default exponential back-off in case of error…
Browse files Browse the repository at this point in the history
…s, instead of a fix 30 sec retry
  • Loading branch information
kispaljr committed Jun 20, 2024
1 parent 61ed84c commit ffb7099
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"strconv"
"strings"
"time"

porchapi "github.com/nephio-project/porch/api/porch/v1alpha1"
configapi "github.com/nephio-project/porch/api/porchconfig/v1alpha1"
Expand Down Expand Up @@ -59,8 +58,6 @@ const (

ConditionTypeStalled = "Stalled" // whether or not the packagevariant object is making progress or not
ConditionTypeReady = "Ready" // whether or notthe reconciliation succeded

requeueDuration = 30 * time.Second
)

//go:generate go run sigs.k8s.io/controller-tools/cmd/[email protected] rbac:headerFile=../../../../../scripts/boilerplate.yaml.txt,roleName=porch-controllers-packagevariants webhook paths="." output:rbac:artifacts:config=../../../config/rbac
Expand Down Expand Up @@ -129,7 +126,7 @@ func (r *PackageVariantReconciler) Reconcile(ctx context.Context, req ctrl.Reque
if err != nil {
setStalledConditionsToTrue(pv, err.Error())
// requeue, as the upstream may appear
return ctrl.Result{RequeueAfter: requeueDuration}, err
return ctrl.Result{}, err
}
meta.SetStatusCondition(&pv.Status.Conditions, metav1.Condition{
Type: ConditionTypeStalled,
Expand All @@ -147,7 +144,7 @@ func (r *PackageVariantReconciler) Reconcile(ctx context.Context, req ctrl.Reque
Message: err.Error(),
})
// requeue; it may be an intermittent error
return ctrl.Result{RequeueAfter: requeueDuration}, nil
return ctrl.Result{}, err
}

setTargetStatusConditions(pv, targets)
Expand Down

0 comments on commit ffb7099

Please sign in to comment.