Skip to content

Commit

Permalink
Merge pull request nephio-project#76 from nokia/pv-fast-error
Browse files Browse the repository at this point in the history
PackageVariant controller: Use the default exponential back-off in case of errors, instead of a constant 30 sec retry
  • Loading branch information
nephio-prow[bot] authored Jun 21, 2024
2 parents 5ac6647 + 0c16cd3 commit b399b8b
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 b399b8b

Please sign in to comment.