in spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/SparkClusterReconciler.java [74:96]
public UpdateControl<SparkCluster> reconcile(
SparkCluster sparkCluster, Context<SparkCluster> context) throws Exception {
LoggingUtils.TrackedMDC trackedMDC = new LoggingUtils.TrackedMDC();
try {
if (sentinelManager.handleSentinelResourceReconciliation(sparkCluster, context.getClient())) {
return UpdateControl.noUpdate();
}
log.debug("Start cluster reconciliation.");
sparkClusterStatusRecorder.updateStatusFromCache(sparkCluster);
SparkClusterContext ctx = new SparkClusterContext(sparkCluster, context, submissionWorker);
List<ClusterReconcileStep> reconcileSteps = getReconcileSteps(sparkCluster);
for (ClusterReconcileStep step : reconcileSteps) {
ReconcileProgress progress = step.reconcile(ctx, sparkClusterStatusRecorder);
if (progress.isCompleted()) {
return ReconcilerUtils.toUpdateControl(sparkCluster, progress);
}
}
return ReconcilerUtils.toUpdateControl(sparkCluster, completeAndDefaultRequeue());
} finally {
log.debug("Reconciliation completed.");
trackedMDC.reset();
}
}