diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index 623822bfa..f782f950b 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -199,12 +199,21 @@ func (d *Deployer) ConditionalDeploy( } if ansibleEE.Status.JobStatus == ansibleeev1.JobStatusFailed { + severity := condition.SeverityWarning + errorReason := condition.ErrorReason + errorMsg := fmt.Sprintf("attempt #%d - execution.name %s execution.namespace %s execution.status.jobstatus: %s", ansibleEE.Status.failed, ansibleEE.Name, ansibleEE.Namespace, ansibleEE.Status.JobStatus) + ansibleCondition := ansibleEE.Status.Conditions.Get(condition.JobReadyCondition) + if ansibleCondition.Reason == condition.JobReasonBackoffLimitExceeded { + severity = condition.SeverityError + errorReason = condition.JobReasonBackoffLimitExceeded + errorMsg = fmt.Sprintf("backoff limit reached for execution.name %s execution.namespace %s execution.status.jobstatus: %s", ansibleEE.Name, ansibleEE.Namespace, ansibleEE.Status.JobStatus) + } log.Info(fmt.Sprintf("Condition %s error", readyCondition)) - err = fmt.Errorf("execution.name %s Execution.namespace %s Execution.status.jobstatus: %s", ansibleEE.Name, ansibleEE.Namespace, ansibleEE.Status.JobStatus) + err = fmt.Errorf(errorMsg) nsConditions.Set(condition.FalseCondition( readyCondition, - condition.ErrorReason, - condition.SeverityError, + errorReason, + severity, readyErrorMessage, err.Error())) }