Skip to content

Commit 4ac78bc

Browse files
author
Mikalai Radchuk
committed
Improve InstallPlan error handling
With this change we no set condition on subscriptions about errors during InstallPlan creation. Previously we were only logging these errors. Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 3030064 commit 4ac78bc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: pkg/controller/operators/catalog/operator.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,20 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
14421442

14431443
installPlanReference, err := o.ensureInstallPlan(logger, namespace, maxGeneration+1, subs, installPlanApproval, steps, bundleLookups)
14441444
if err != nil {
1445-
logger.WithError(err).Debug("error ensuring installplan")
1445+
err := fmt.Errorf("error ensuring installplan: %s", err)
1446+
logger.Infof("%v", err)
1447+
1448+
_, updateErr := o.updateSubscriptionStatuses(
1449+
o.setSubsCond(subs, v1alpha1.SubscriptionCondition{
1450+
Type: v1alpha1.SubscriptionBundleUnpackFailed,
1451+
Reason: "EnsureInstallPlanFailed",
1452+
Message: err.Error(),
1453+
Status: corev1.ConditionTrue,
1454+
}))
1455+
if updateErr != nil {
1456+
logger.WithError(updateErr).Debug("failed to update subs conditions")
1457+
return updateErr
1458+
}
14461459
return err
14471460
}
14481461
updatedSubs = o.setIPReference(updatedSubs, maxGeneration+1, installPlanReference)

0 commit comments

Comments
 (0)