diff --git a/pkg/controller/operators/catalog/operator.go b/pkg/controller/operators/catalog/operator.go index 5986d88ceaa..42cf62daeaa 100644 --- a/pkg/controller/operators/catalog/operator.go +++ b/pkg/controller/operators/catalog/operator.go @@ -881,7 +881,21 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, sub for _, installPlan := range installPlans { if installPlan.Status.CSVManifestsMatch(steps) { logger.Infof("found InstallPlan with matching manifests: %s", installPlan.GetName()) - return reference.GetReference(installPlan) + + for _, sub := range subs { + ownerutil.EnsureOwner(installPlan, sub) + } + updatedPlan, err := o.client.OperatorsV1alpha1().InstallPlans(installPlan.GetNamespace()).Update(installPlan) + + updatedPlan.Status.Phase = v1alpha1.InstallPlanPhaseInstalling + for _, step := range updatedPlan.Status.Plan { + step.Status = v1alpha1.StepStatusUnknown + } + _, err = o.client.OperatorsV1alpha1().InstallPlans(namespace).UpdateStatus(updatedPlan) + if err != nil { + return nil, err + } + return reference.GetReference(updatedPlan) } } logger.Warn("no installplan found with matching manifests, creating new one")