From e8de6f3ed09f01317ed15a93232f34222f7e6555 Mon Sep 17 00:00:00 2001 From: Edmund Ochieng Date: Thu, 21 Sep 2023 13:27:47 -0500 Subject: [PATCH] Remove code to reset previous error while reconciling custom resource Previous failure condition status is set to false when subsequent reconcile begins. This is unnecessary since the conditions are true at the time of reporting. The failure condition can however, be reset when reconcile completes successfully. Signed-off-by: Edmund Ochieng --- internal/ansible/controller/reconcile.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/ansible/controller/reconcile.go b/internal/ansible/controller/reconcile.go index 0919f33..9052c2a 100644 --- a/internal/ansible/controller/reconcile.go +++ b/internal/ansible/controller/reconcile.go @@ -302,11 +302,6 @@ func (r *AnsibleOperatorReconciler) markRunning(ctx context.Context, nn types.Na crStatus := getStatus(u) // If there is no current status add that we are working on this resource. - errCond := ansiblestatus.GetCondition(crStatus, ansiblestatus.FailureConditionType) - if errCond != nil { - errCond.Status = v1.ConditionFalse - ansiblestatus.SetCondition(&crStatus, *errCond) - } successCond := ansiblestatus.GetCondition(crStatus, ansiblestatus.SuccessfulConditionType) if successCond != nil { successCond.Status = v1.ConditionFalse