@@ -569,6 +569,11 @@ func TestSusbcriptionWithStartingCSV(t *testing.T) {
569
569
fetchedInstallPlan , err := fetchInstallPlan (t , crc , installPlanName , requiresApprovalChecker )
570
570
require .NoError (t , err )
571
571
572
+ // Ensure that only 1 installplan was created
573
+ ips , err := crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).List (metav1.ListOptions {})
574
+ require .NoError (t , err )
575
+ require .Len (t , ips .Items , 1 )
576
+
572
577
// Ensure that csvA and its crd are found in the plan
573
578
csvFound := false
574
579
crdFound := false
@@ -590,6 +595,21 @@ func TestSusbcriptionWithStartingCSV(t *testing.T) {
590
595
require .True (t , csvFound , "expected csv not found in installplan" )
591
596
require .True (t , crdFound , "expected crd not found in installplan" )
592
597
598
+ // Ensure that csvB is not found in the plan
599
+ csvFound = false
600
+ for _ , s := range fetchedInstallPlan .Status .Plan {
601
+ require .Equal (t , csvA .GetName (), s .Resolving , "unexpected resolution found" )
602
+ require .Equal (t , v1alpha1 .StepStatusUnknown , s .Status , "status should be unknown" )
603
+ require .Equal (t , catalogSourceName , s .Resource .CatalogSource , "incorrect catalogsource on step resource" )
604
+ switch kind := s .Resource .Kind ; kind {
605
+ case v1alpha1 .ClusterServiceVersionKind :
606
+ if s .Resource .Name == csvB .GetName () {
607
+ csvFound = true
608
+ }
609
+ }
610
+ }
611
+ require .False (t , csvFound , "expected csv not found in installplan" )
612
+
593
613
// Approve the installplan and wait for csvA to be installed
594
614
fetchedInstallPlan .Spec .Approved = true
595
615
_ , err = crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).Update (fetchedInstallPlan )
@@ -613,6 +633,11 @@ func TestSusbcriptionWithStartingCSV(t *testing.T) {
613
633
614
634
_ , err = awaitCSV (t , crc , testNamespace , csvB .GetName (), csvSucceededChecker )
615
635
require .NoError (t , err )
636
+
637
+ // Ensure that 2 installplans were created
638
+ ips , err = crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).List (metav1.ListOptions {})
639
+ require .NoError (t , err )
640
+ require .Len (t , ips .Items , 2 )
616
641
}
617
642
618
643
func TestSubscriptionUpdatesMultipleIntermediates (t * testing.T ) {
0 commit comments