Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions controllers/clustersummary_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const (
// normalRequeueAfter is how long to wait before checking again to see if the cluster can be moved
// to ready after or workload features (for instance ingress or reporter) have failed
normalRequeueAfter = 10 * time.Second

// dryRunRequeueAfter is how long to wait before reconciling a ClusterSummary in DryRun mode
dryRunRequeueAfter = 20 * time.Second
)

type ReportMode int
Expand Down Expand Up @@ -383,6 +386,13 @@ func (r *ClusterSummaryReconciler) reconcileNormal(
}

logger.V(logs.LogInfo).Info("Reconciling ClusterSummary success")

if clusterSummaryScope.IsDryRunSync() {
r.resetFeatureStatusToProvisioning(clusterSummaryScope)
// we need to keep retrying in DryRun ClusterSummaries
return reconcile.Result{Requeue: true, RequeueAfter: dryRunRequeueAfter}, nil
}

return reconcile.Result{}, nil
}

Expand Down Expand Up @@ -1318,3 +1328,14 @@ func (r *ClusterSummaryReconciler) cleanupQueuedCleanOperations(clusterSummary *
r.Deployer.CleanupEntries(clusterSummary.Spec.ClusterNamespace, clusterSummary.Spec.ClusterName, clusterSummary.Name,
string(configv1beta1.FeatureResources), clusterSummary.Spec.ClusterType, true)
}

// resetFeatureStatusToProvisioning reset status from Provisioned to Provisioning
func (r *ClusterSummaryReconciler) resetFeatureStatusToProvisioning(clusterSummaryScope *scope.ClusterSummaryScope) {
status := configv1beta1.FeatureStatusProvisioning
for i := range clusterSummaryScope.ClusterSummary.Status.FeatureSummaries {
fs := &clusterSummaryScope.ClusterSummary.Status.FeatureSummaries[i]
if fs.Status == configv1beta1.FeatureStatusProvisioned {
fs.Status = status
}
}
}
4 changes: 0 additions & 4 deletions controllers/handlers_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ func deployResources(ctx context.Context, c client.Client,
return err
}

if clusterSummary.Spec.ClusterProfileSpec.SyncMode == configv1beta1.SyncModeDryRun {
return &configv1beta1.DryRunReconciliationError{}
}

if deployError != nil {
return deployError
}
Expand Down