From d2c5300f44b8419b5302a1fbc6e158b1a7ef55e3 Mon Sep 17 00:00:00 2001 From: Gianluca Mardente Date: Sun, 29 Mar 2026 18:03:09 +0200 Subject: [PATCH] (bug) licence checks Previously, if an error occurred while verifying Sveltos License, the code would default to marking the license as Invalid. In the Sveltos reconciliation logic, an "Invalid" status causes the controller to stop processing, requiring manual intervention to restart (restart addon-controller) This PR updates the validation logic to retry if any such error happens. --- controllers/clusterpromotion_controller.go | 2 +- controllers/clustersummary_controller.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/controllers/clusterpromotion_controller.go b/controllers/clusterpromotion_controller.go index 241e7920..0656be3f 100644 --- a/controllers/clusterpromotion_controller.go +++ b/controllers/clusterpromotion_controller.go @@ -172,7 +172,7 @@ func (r *ClusterPromotionReconciler) reconcileNormal( isEligible, err := r.verifyStageEligibility(ctx, promotionScope, logger) if err != nil { - return reconcile.Result{Requeue: true, RequeueAfter: normalRequeueAfter} + return reconcile.Result{Requeue: true, RequeueAfter: licenseRequeueAfter} } if !isEligible { diff --git a/controllers/clustersummary_controller.go b/controllers/clustersummary_controller.go index 97849def..bd2f759c 100644 --- a/controllers/clustersummary_controller.go +++ b/controllers/clustersummary_controller.go @@ -79,6 +79,9 @@ const ( // dryRunRequeueAfter is how long to wait before reconciling a ClusterSummary in DryRun mode dryRunRequeueAfter = 60 * time.Second + + // licenseRequeueAfter is how long to wait before retrying after a license fetch error + licenseRequeueAfter = 60 * time.Second ) type ReportMode int @@ -417,7 +420,7 @@ func (r *ClusterSummaryReconciler) reconcileNormal(ctx context.Context, if !isEligible { r.updateStatusWithMissingLicenseError(clusterSummaryScope, logger) - return reconcile.Result{}, nil + return reconcile.Result{Requeue: true, RequeueAfter: licenseRequeueAfter}, nil } updateMapErrs := r.updateMaps(ctx, clusterSummaryScope, logger)