@@ -1399,6 +1399,73 @@ func TestSyncResolvingNamespace(t *testing.T) {
1399
1399
},
1400
1400
wantErr : fmt .Errorf ("some error" ),
1401
1401
},
1402
+ {
1403
+ name : "HadErrorShouldClearError" ,
1404
+ fields : fields {
1405
+ clientOptions : []clientfake.Option {clientfake .WithSelfLinks (t )},
1406
+ existingOLMObjs : []runtime.Object {
1407
+ & v1alpha1.Subscription {
1408
+ TypeMeta : metav1.TypeMeta {
1409
+ Kind : v1alpha1 .SubscriptionKind ,
1410
+ APIVersion : v1alpha1 .SchemeGroupVersion .String (),
1411
+ },
1412
+ ObjectMeta : metav1.ObjectMeta {
1413
+ Name : "sub" ,
1414
+ Namespace : testNamespace ,
1415
+ },
1416
+ Spec : & v1alpha1.SubscriptionSpec {
1417
+ CatalogSource : "src" ,
1418
+ CatalogSourceNamespace : testNamespace ,
1419
+ },
1420
+ Status : v1alpha1.SubscriptionStatus {
1421
+ InstalledCSV : "sub-csv" ,
1422
+ State : "AtLatestKnown" ,
1423
+ Conditions : []v1alpha1.SubscriptionCondition {
1424
+ {
1425
+ Type : v1alpha1 .SubscriptionBundleUnpacking ,
1426
+ Status : corev1 .ConditionFalse ,
1427
+ },
1428
+ {
1429
+ Type : v1alpha1 .SubscriptionResolutionFailed ,
1430
+ Reason : "ConstraintsNotSatisfiable" ,
1431
+ Message : "constraints not satisfiable: no operators found from catalog src in namespace testNamespace referenced by subscrition sub, subscription sub exists" ,
1432
+ Status : corev1 .ConditionTrue ,
1433
+ },
1434
+ },
1435
+ LastUpdated : now ,
1436
+ },
1437
+ },
1438
+ },
1439
+ resolveErr : nil ,
1440
+ },
1441
+ wantSubscriptions : []* v1alpha1.Subscription {
1442
+ {
1443
+ TypeMeta : metav1.TypeMeta {
1444
+ Kind : v1alpha1 .SubscriptionKind ,
1445
+ APIVersion : v1alpha1 .SchemeGroupVersion .String (),
1446
+ },
1447
+ ObjectMeta : metav1.ObjectMeta {
1448
+ Name : "sub" ,
1449
+ Namespace : testNamespace ,
1450
+ },
1451
+ Spec : & v1alpha1.SubscriptionSpec {
1452
+ CatalogSource : "src" ,
1453
+ CatalogSourceNamespace : testNamespace ,
1454
+ },
1455
+ Status : v1alpha1.SubscriptionStatus {
1456
+ InstalledCSV : "sub-csv" ,
1457
+ State : "AtLatestKnown" ,
1458
+ LastUpdated : now ,
1459
+ Conditions : []v1alpha1.SubscriptionCondition {
1460
+ {
1461
+ Type : v1alpha1 .SubscriptionBundleUnpacking ,
1462
+ Status : corev1 .ConditionFalse ,
1463
+ },
1464
+ },
1465
+ },
1466
+ },
1467
+ },
1468
+ },
1402
1469
}
1403
1470
for _ , tt := range tests {
1404
1471
t .Run (tt .name , func (t * testing.T ) {
0 commit comments