@@ -659,6 +659,8 @@ func TestCreateInstallPlanWithPreExistingCRDOwners(t *testing.T) {
659
659
// Update the subscription resource to point to the beta CSV
660
660
err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
661
661
require .NoError (t , err )
662
+ // Delete orphaned csv
663
+ require .NoError (t , crc .OperatorsV1alpha1 ().ClusterServiceVersions (testNamespace ).Delete (mainStableCSV .GetName (), & metav1.DeleteOptions {}))
662
664
663
665
// existing cleanup should remove this
664
666
createSubscriptionForCatalog (t , crc , testNamespace , subscriptionName , mainCatalogSourceName , mainPackageName , betaChannel , "" , v1alpha1 .ApprovalAutomatic )
@@ -1192,6 +1194,8 @@ func TestInstallPlanWithDeprecatedVersionCRD(t *testing.T) {
1192
1194
// Update the subscription resource to point to the beta CSV
1193
1195
err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1194
1196
require .NoError (t , err )
1197
+ // Delete orphaned csv
1198
+ require .NoError (t , crc .OperatorsV1alpha1 ().ClusterServiceVersions (testNamespace ).Delete (mainStableCSV .GetName (), & metav1.DeleteOptions {}))
1195
1199
1196
1200
// existing cleanup should remove this
1197
1201
createSubscriptionForCatalog (t , crc , testNamespace , subscriptionName , mainCatalogSourceName , mainPackageName , betaChannel , "" , v1alpha1 .ApprovalAutomatic )
@@ -1241,6 +1245,8 @@ func TestInstallPlanWithDeprecatedVersionCRD(t *testing.T) {
1241
1245
// Update the subscription resource to point to the beta CSV
1242
1246
err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1243
1247
require .NoError (t , err )
1248
+ // Delete orphaned csv
1249
+ require .NoError (t , crc .OperatorsV1alpha1 ().ClusterServiceVersions (testNamespace ).Delete (mainBetaCSV .GetName (), & metav1.DeleteOptions {}))
1244
1250
1245
1251
// existing cleanup should remove this
1246
1252
createSubscriptionForCatalog (t , crc , testNamespace , subscriptionName , mainCatalogSourceName , mainPackageName , deltaChannel , "" , v1alpha1 .ApprovalAutomatic )
0 commit comments