@@ -114,10 +114,7 @@ func (r *DSPAReconciler) buildCondition(conditionType string, dspa *dspav1alpha1
114
114
condition .ObservedGeneration = dspa .Generation
115
115
condition .Status = metav1 .ConditionFalse
116
116
condition .Reason = reason
117
-
118
- if dspa .Status .Conditions == nil {
119
- condition .LastTransitionTime = metav1 .Now ()
120
- }
117
+ condition .LastTransitionTime = metav1 .Now ()
121
118
122
119
return condition
123
120
}
@@ -225,28 +222,16 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
225
222
// Initialize conditions
226
223
var conditions []metav1.Condition
227
224
228
- databaseReady := r .buildCondition (config .DatabaseReady , dspa , config .DatabaseReady )
229
225
err = r .ReconcileDatabase (ctx , dspa , params )
230
226
if err != nil {
231
227
return ctrl.Result {}, err
232
228
}
233
229
234
- if r .isDeploymentAvailable (ctx , dspa , "mariadb" ) {
235
- databaseReady .Status = metav1 .ConditionTrue
236
- }
237
- conditions = append (conditions , databaseReady )
238
-
239
- objectStorageReady := r .buildCondition (config .ObjectStorageReady , dspa , config .ObjectStorageReady )
240
230
err = r .ReconcileStorage (ctx , dspa , params )
241
231
if err != nil {
242
232
return ctrl.Result {}, err
243
233
}
244
234
245
- if r .isDeploymentAvailable (ctx , dspa , "minio" ) {
246
- objectStorageReady .Status = metav1 .ConditionTrue
247
- }
248
- conditions = append (conditions , objectStorageReady )
249
-
250
235
err = r .ReconcileCommon (dspa , params )
251
236
if err != nil {
252
237
return ctrl.Result {}, err
@@ -285,17 +270,11 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
285
270
}
286
271
conditions = append (conditions , scheduledWorkflowReady )
287
272
288
- userInterfaceReady := r .buildCondition (config .UserInterfaceReady , dspa , config .MinimumReplicasAvailable )
289
273
err = r .ReconcileUI (dspa , params )
290
274
if err != nil {
291
275
return ctrl.Result {}, err
292
276
}
293
277
294
- if r .isDeploymentAvailable (ctx , dspa , "ds-pipeline-ui" ) {
295
- userInterfaceReady .Status = metav1 .ConditionTrue
296
- }
297
- conditions = append (conditions , userInterfaceReady )
298
-
299
278
err = r .ReconcileViewerCRD (dspa , params )
300
279
if err != nil {
301
280
return ctrl.Result {}, err
@@ -307,22 +286,17 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
307
286
crReady .Type = config .CrReady
308
287
309
288
// Compute Ready Logic for the CR
310
- if (( apiServerReady .Status == metav1 .ConditionTrue ) &&
289
+ if (apiServerReady .Status == metav1 .ConditionTrue ) &&
311
290
(persistenceAgentReady .Status == metav1 .ConditionTrue ) &&
312
- (scheduledWorkflowReady .Status == metav1 .ConditionTrue ) &&
313
- (databaseReady .Status == metav1 .ConditionTrue ) &&
314
- (objectStorageReady .Status == metav1 .ConditionTrue )) &&
315
- (userInterfaceReady .Status == metav1 .ConditionTrue || (userInterfaceReady .Status == metav1 .ConditionFalse && ! dspa .Spec .MlPipelineUI .Deploy )) {
291
+ (scheduledWorkflowReady .Status == metav1 .ConditionTrue ) {
316
292
crReady .Status = metav1 .ConditionTrue
317
293
} else {
318
294
crReady .Status = metav1 .ConditionFalse
319
295
}
320
296
conditions = append (conditions , crReady )
321
297
322
298
for i , condition := range dspa .Status .Conditions {
323
- if condition .Status != conditions [i ].Status {
324
- conditions [i ].LastTransitionTime = metav1 .Now ()
325
- } else {
299
+ if condition .Status == conditions [i ].Status {
326
300
conditions [i ].LastTransitionTime = condition .LastTransitionTime
327
301
}
328
302
}
0 commit comments