@@ -406,11 +406,6 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (res ctrl.Result, err error) {
406
406
return ctrl.Result {}, err
407
407
}
408
408
409
- // We always create the status from scratch since
410
- // we don't know if the previous status is still
411
- // valid from the last time we reconciled
412
- obj .Object ["status" ] = nil
413
-
414
409
u := updater .New (r .client )
415
410
defer func () {
416
411
applyErr := u .Apply (ctx , obj )
@@ -423,7 +418,10 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (res ctrl.Result, err error) {
423
418
if err != nil {
424
419
u .UpdateStatus (
425
420
updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionTrue , conditions .ReasonErrorGettingClient , err )),
426
- updater .EnsureCondition (conditions .Deployed (corev1 .ConditionUnknown , conditions .ReasonErrorGettingClient , err )),
421
+ updater .EnsureConditionUnknown (conditions .TypeDeployed ),
422
+ updater .EnsureConditionUnknown (conditions .TypeInitialized ),
423
+ updater .EnsureConditionUnknown (conditions .TypeReleaseFailed ),
424
+ updater .EnsureDeployedRelease (nil ),
427
425
)
428
426
// NOTE: If obj has the uninstall finalizer, that means a release WAS deployed at some point
429
427
// in the past, but we don't know if it still is because we don't have an actionClient to check.
@@ -460,13 +458,21 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (res ctrl.Result, err error) {
460
458
461
459
vals , err := r .getValues (obj )
462
460
if err != nil {
463
- u .UpdateStatus (updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionTrue , conditions .ReasonErrorGettingValues , err )))
461
+ u .UpdateStatus (
462
+ updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionTrue , conditions .ReasonErrorGettingValues , err )),
463
+ updater .EnsureConditionUnknown (conditions .TypeReleaseFailed ),
464
+ )
464
465
return ctrl.Result {}, err
465
466
}
466
467
467
468
rel , state , err := r .getReleaseState (actionClient , obj , vals .AsMap ())
468
469
if err != nil {
469
- u .UpdateStatus (updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionTrue , conditions .ReasonErrorGettingReleaseState , err )))
470
+ u .UpdateStatus (
471
+ updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionTrue , conditions .ReasonErrorGettingReleaseState , err )),
472
+ updater .EnsureConditionUnknown (conditions .TypeReleaseFailed ),
473
+ updater .EnsureConditionUnknown (conditions .TypeDeployed ),
474
+ updater .EnsureDeployedRelease (nil ),
475
+ )
470
476
return ctrl.Result {}, err
471
477
}
472
478
u .UpdateStatus (updater .EnsureCondition (conditions .Irreconcilable (corev1 .ConditionFalse , "" , "" )))
0 commit comments