Skip to content

Commit a63b449

Browse files
authored
Return an error when the IP status cannot be updated (#3410)
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]>
1 parent 619c2eb commit a63b449

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/controller/operators/catalog/operator.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -2097,9 +2097,8 @@ func (o *Operator) setInstallPlanInstalledCond(ip *v1alpha1.InstallPlan, reason
20972097
ip.Status.SetCondition(v1alpha1.ConditionFailed(v1alpha1.InstallPlanInstalled, reason, message, &now))
20982098
outIP, err := o.client.OperatorsV1alpha1().InstallPlans(ip.GetNamespace()).UpdateStatus(context.TODO(), ip, metav1.UpdateOptions{})
20992099
if err != nil {
2100-
logger = logger.WithField("updateError", err.Error())
2101-
logger.Errorf("error updating InstallPlan status")
2102-
return nil, nil
2100+
logger.WithError(err).Error("error updating InstallPlan status")
2101+
return nil, fmt.Errorf("error updating InstallPlan status: %w", err)
21032102
}
21042103
return outIP, nil
21052104
}

0 commit comments

Comments
 (0)