Skip to content

Commit

Permalink
Return an error when the IP status cannot be updated (#3410)
Browse files Browse the repository at this point in the history
This status update function was not returning an error when an error
occured, and could lead to a crash due returning nil for the IP.

Signed-off-by: Todd Short <[email protected]>
  • Loading branch information
tmshort authored Oct 10, 2024
1 parent 619c2eb commit a63b449
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/controller/operators/catalog/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2097,9 +2097,8 @@ func (o *Operator) setInstallPlanInstalledCond(ip *v1alpha1.InstallPlan, reason
ip.Status.SetCondition(v1alpha1.ConditionFailed(v1alpha1.InstallPlanInstalled, reason, message, &now))
outIP, err := o.client.OperatorsV1alpha1().InstallPlans(ip.GetNamespace()).UpdateStatus(context.TODO(), ip, metav1.UpdateOptions{})
if err != nil {
logger = logger.WithField("updateError", err.Error())
logger.Errorf("error updating InstallPlan status")
return nil, nil
logger.WithError(err).Error("error updating InstallPlan status")
return nil, fmt.Errorf("error updating InstallPlan status: %w", err)
}
return outIP, nil
}
Expand Down

0 comments on commit a63b449

Please sign in to comment.