Skip to content

Commit 3e7dfb7

Browse files
committed
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 (cherry picked from commit 9500f27)
1 parent b0d86a0 commit 3e7dfb7

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
@@ -2070,9 +2070,8 @@ func (o *Operator) setInstallPlanInstalledCond(ip *v1alpha1.InstallPlan, reason
20702070
ip.Status.SetCondition(v1alpha1.ConditionFailed(v1alpha1.InstallPlanInstalled, reason, message, &now))
20712071
outIP, err := o.client.OperatorsV1alpha1().InstallPlans(ip.GetNamespace()).UpdateStatus(context.TODO(), ip, metav1.UpdateOptions{})
20722072
if err != nil {
2073-
logger = logger.WithField("updateError", err.Error())
2074-
logger.Errorf("error updating InstallPlan status")
2075-
return nil, nil
2073+
logger.WithError(err).Error("error updating InstallPlan status")
2074+
return nil, fmt.Errorf("error updating InstallPlan status: %w", err)
20762075
}
20772076
return outIP, nil
20782077
}

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)