Skip to content

Commit 9500f27

Browse files
tmshortci-robot
authored andcommitted
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]> Upstream-repository: operator-lifecycle-manager Upstream-commit: a63b449eb6ee44d716e6e21aae639db217ebb6e1
1 parent 09a7b5b commit 9500f27

File tree

2 files changed

+4
-6
lines changed
  • staging/operator-lifecycle-manager/pkg/controller/operators/catalog
  • vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog

2 files changed

+4
-6
lines changed

staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go

Lines changed: 2 additions & 3 deletions
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
}

vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)