Skip to content

Commit

Permalink
Remove code to reset previous error while reconciling custom resource
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
OchiengEd committed Sep 29, 2023
1 parent cfeded2 commit 0d96212
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/ansible/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d96212

Please sign in to comment.