Skip to content

Commit df0cd49

Browse files
committed
fix: checkinstallplan status in bundle e2e test
1 parent e72d31a commit df0cd49

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

test/e2e/bundle_e2e_test.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package e2e
22

33
import (
44
"context"
5-
"k8s.io/apimachinery/pkg/runtime/schema"
6-
"k8s.io/client-go/dynamic"
75

86
. "github.com/onsi/ginkgo"
97
. "github.com/onsi/gomega"
8+
109
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10+
"k8s.io/apimachinery/pkg/runtime/schema"
11+
"k8s.io/client-go/dynamic"
1112

1213
"github.com/operator-framework/api/pkg/operators/v1alpha1"
1314
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
@@ -45,6 +46,8 @@ var _ = Describe("Installing bundles with new object types", func() {
4546
sourceName = "test-catalog"
4647
imageName = "quay.io/olmtest/single-bundle-index:pdb"
4748
)
49+
50+
var installPlanRef string
4851
// create catalog source
4952
source := &v1alpha1.CatalogSource{
5053
TypeMeta: metav1.TypeMeta{
@@ -70,9 +73,19 @@ var _ = Describe("Installing bundles with new object types", func() {
7073

7174
// Wait for the Subscription to succeed
7275
Eventually(func() error {
73-
_, err = fetchSubscription(operatorClient, testNamespace, subName, subscriptionStateAtLatestChecker)
76+
sub, err := fetchSubscription(operatorClient, testNamespace, subName, subscriptionStateAtLatestChecker)
77+
if sub != nil && sub.Status.InstallPlanRef != nil {
78+
installPlanRef = sub.Status.InstallPlanRef.Name
79+
}
80+
return err
81+
}).Should(BeNil())
82+
83+
// Wait for the installplan to complete (5 minute timeout)
84+
Eventually(func() error {
85+
_, err := fetchInstallPlan(GinkgoT(), operatorClient, installPlanRef, buildInstallPlanPhaseCheckFunc(v1alpha1.InstallPlanPhaseComplete))
7486
return err
7587
}).Should(BeNil())
88+
ctx.Ctx().Logf("install plan %s completed", installPlanRef)
7689
})
7790

7891
It("should create the additional bundle objects", func() {

0 commit comments

Comments
 (0)