From ece77b8760e76ee1f718f598a7c92423ddc56f6c Mon Sep 17 00:00:00 2001 From: rashmigottipati Date: Fri, 29 Jan 2021 10:56:05 -0500 Subject: [PATCH] Check if subscription is nil for run bundle upgrade Signed-off-by: rashmigottipati --- internal/olm/operator/registry/operator_installer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/olm/operator/registry/operator_installer.go b/internal/olm/operator/registry/operator_installer.go index 20081de18a..f02329493f 100644 --- a/internal/olm/operator/registry/operator_installer.go +++ b/internal/olm/operator/registry/operator_installer.go @@ -123,6 +123,10 @@ func (o OperatorInstaller) UpgradeOperator(ctx context.Context) (*v1alpha1.Clust } } + if subscription == nil { + return nil, fmt.Errorf("subscription for package %q not found", o.PackageName) + } + log.Infof("Found existing subscription with name %s and namespace %s", subscription.Name, subscription.Namespace) // todo: attempt #1 to trigger install plan for the subscription and