@@ -32,7 +32,6 @@ import (
32
32
33
33
"github.com/operator-framework/api/pkg/lib/version"
34
34
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
35
- "github.com/operator-framework/api/pkg/operators/v1alpha1"
36
35
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
37
36
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
38
37
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
@@ -170,6 +169,7 @@ var _ = Describe("Subscription", func() {
170
169
171
170
By (fmt .Sprintf ("creating a subscription: %s/%s" , generatedNamespace .GetName (), testSubscriptionName ))
172
171
cleanup , _ := createSubscription (GinkgoT (), crc , generatedNamespace .GetName (), testSubscriptionName , testPackageName , betaChannel , operatorsv1alpha1 .ApprovalAutomatic )
172
+
173
173
defer cleanup ()
174
174
175
175
By ("waiting for the subscription to have a current CSV and be at latest" )
@@ -366,6 +366,7 @@ var _ = Describe("Subscription", func() {
366
366
367
367
By (`Set the InstallPlan's approved to True` )
368
368
Eventually (Apply (newInstallPlan , func (p * operatorsv1alpha1.InstallPlan ) error {
369
+
369
370
p .Spec .Approved = true
370
371
return nil
371
372
})).Should (Succeed ())
@@ -1084,6 +1085,7 @@ var _ = Describe("Subscription", func() {
1084
1085
By (`Set the InstallPlan's approval mode to Manual` )
1085
1086
Eventually (Apply (plan , func (p * operatorsv1alpha1.InstallPlan ) error {
1086
1087
p .Spec .Approval = operatorsv1alpha1 .ApprovalManual
1088
+
1087
1089
p .Spec .Approved = false
1088
1090
return nil
1089
1091
})).Should (Succeed ())
@@ -2440,7 +2442,7 @@ var _ = Describe("Subscription", func() {
2440
2442
if err != nil {
2441
2443
return "" , err
2442
2444
}
2443
- cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpacking )
2445
+ cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpacking )
2444
2446
return cond .Status , nil
2445
2447
},
2446
2448
5 * time .Minute ,
@@ -2454,7 +2456,7 @@ var _ = Describe("Subscription", func() {
2454
2456
if err != nil {
2455
2457
return "" , err
2456
2458
}
2457
- cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed )
2459
+ cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpackFailed )
2458
2460
return cond .Status , nil
2459
2461
},
2460
2462
5 * time .Minute ,
@@ -2483,9 +2485,9 @@ var _ = Describe("Subscription", func() {
2483
2485
if err != nil {
2484
2486
return "" , err
2485
2487
}
2486
- cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed )
2488
+ cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpackFailed )
2487
2489
if cond .Status != corev1 .ConditionTrue || cond .Reason != "BundleUnpackFailed" {
2488
- return "" , fmt .Errorf ("%s condition not found" , v1alpha1 .SubscriptionBundleUnpackFailed )
2490
+ return "" , fmt .Errorf ("%s condition not found" , operatorsv1alpha1 .SubscriptionBundleUnpackFailed )
2489
2491
}
2490
2492
2491
2493
return cond .Message , nil
@@ -2527,7 +2529,7 @@ var _ = Describe("Subscription", func() {
2527
2529
2528
2530
By ("waiting for the subscription to have v0.2.0 installed with a Bundle Deprecated condition" )
2529
2531
sub , err := fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionHasCondition (
2530
- v1alpha1 .SubscriptionBundleDeprecated ,
2532
+ operatorsv1alpha1 .SubscriptionBundleDeprecated ,
2531
2533
corev1 .ConditionTrue ,
2532
2534
"" ,
2533
2535
"olm.bundle/example-operator.v0.2.0: bundle \" example-operator.v0.2.0\" has been deprecated. Please switch to a different one." ))
@@ -2557,7 +2559,7 @@ var _ = Describe("Subscription", func() {
2557
2559
Expect (err ).To (BeNil ())
2558
2560
2559
2561
By ("waiting for the subscription to have v0.3.0 installed with no deprecation message present" )
2560
- _ , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionDoesNotHaveCondition (v1alpha1 .SubscriptionDeprecated ))
2562
+ _ , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionDoesNotHaveCondition (operatorsv1alpha1 .SubscriptionDeprecated ))
2561
2563
Expect (err ).Should (BeNil ())
2562
2564
})
2563
2565
@@ -2574,7 +2576,7 @@ var _ = Describe("Subscription", func() {
2574
2576
2575
2577
By ("waiting for the subscription to have v0.2.0 installed with a Bundle Deprecated condition" )
2576
2578
sub , err := fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionHasCondition (
2577
- v1alpha1 .SubscriptionBundleDeprecated ,
2579
+ operatorsv1alpha1 .SubscriptionBundleDeprecated ,
2578
2580
corev1 .ConditionTrue ,
2579
2581
"" ,
2580
2582
"olm.bundle/example-operator.v0.2.0: bundle \" example-operator.v0.2.0\" has been deprecated. Please switch to a different one." ))
@@ -2592,10 +2594,10 @@ var _ = Describe("Subscription", func() {
2592
2594
Expect (err ).To (BeNil ())
2593
2595
2594
2596
By ("waiting for the subscription to have v0.3.0 installed with a Package deprecated condition" )
2595
- _ , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionDoesNotHaveCondition (v1alpha1 .SubscriptionBundleDeprecated ))
2597
+ _ , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionDoesNotHaveCondition (operatorsv1alpha1 .SubscriptionBundleDeprecated ))
2596
2598
Expect (err ).Should (BeNil ())
2597
2599
sub , err = fetchSubscription (crc , generatedNamespace .GetName (), subName , subscriptionHasCondition (
2598
- v1alpha1 .SubscriptionPackageDeprecated ,
2600
+ operatorsv1alpha1 .SubscriptionPackageDeprecated ,
2599
2601
corev1 .ConditionTrue ,
2600
2602
"" ,
2601
2603
"olm.package/packageA: packageA has been deprecated. Please switch to packageB." ))
@@ -2650,9 +2652,9 @@ var _ = Describe("Subscription", func() {
2650
2652
if err != nil {
2651
2653
return false , err
2652
2654
}
2653
- cond := sub .Status .GetCondition (v1alpha1 .SubscriptionDeprecated )
2655
+ cond := sub .Status .GetCondition (operatorsv1alpha1 .SubscriptionDeprecated )
2654
2656
if cond .Status != corev1 .ConditionTrue {
2655
- return false , fmt .Errorf ("%s condition not found" , v1alpha1 .SubscriptionDeprecated )
2657
+ return false , fmt .Errorf ("%s condition not found" , operatorsv1alpha1 .SubscriptionDeprecated )
2656
2658
}
2657
2659
2658
2660
return true , nil
@@ -2774,8 +2776,8 @@ properties:
2774
2776
if err != nil {
2775
2777
return err
2776
2778
}
2777
- if cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status != corev1 .ConditionTrue || cond .Reason != "BundleUnpackFailed" {
2778
- return fmt .Errorf ("%s condition not found" , v1alpha1 .SubscriptionBundleUnpackFailed )
2779
+ if cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status != corev1 .ConditionTrue || cond .Reason != "BundleUnpackFailed" {
2780
+ return fmt .Errorf ("%s condition not found" , operatorsv1alpha1 .SubscriptionBundleUnpackFailed )
2779
2781
}
2780
2782
return nil
2781
2783
},
@@ -2806,11 +2808,11 @@ properties:
2806
2808
if err != nil {
2807
2809
return err
2808
2810
}
2809
- if cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpacking ); cond .Status != corev1 .ConditionUnknown {
2810
- return fmt .Errorf ("subscription condition %s has unexpected value %s, expected %s" , v1alpha1 .SubscriptionBundleUnpacking , cond .Status , corev1 .ConditionFalse )
2811
+ if cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpacking ); cond .Status != corev1 .ConditionUnknown {
2812
+ return fmt .Errorf ("subscription condition %s has unexpected value %s, expected %s" , operatorsv1alpha1 .SubscriptionBundleUnpacking , cond .Status , corev1 .ConditionFalse )
2811
2813
}
2812
- if cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status != corev1 .ConditionUnknown {
2813
- return fmt .Errorf ("unexpected condition %s on subscription" , v1alpha1 .SubscriptionBundleUnpackFailed )
2814
+ if cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status != corev1 .ConditionUnknown {
2815
+ return fmt .Errorf ("unexpected condition %s on subscription" , operatorsv1alpha1 .SubscriptionBundleUnpackFailed )
2814
2816
}
2815
2817
return nil
2816
2818
}).Should (Succeed ())
@@ -2846,11 +2848,11 @@ properties:
2846
2848
if err != nil {
2847
2849
return err
2848
2850
}
2849
- if cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpacking ); cond .Status == corev1 .ConditionTrue {
2850
- return fmt .Errorf ("unexpected condition status for %s on subscription %s" , v1alpha1 .SubscriptionBundleUnpacking , subName )
2851
+ if cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpacking ); cond .Status == corev1 .ConditionTrue {
2852
+ return fmt .Errorf ("unexpected condition status for %s on subscription %s" , operatorsv1alpha1 .SubscriptionBundleUnpacking , subName )
2851
2853
}
2852
- if cond := fetched .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status == corev1 .ConditionTrue {
2853
- return fmt .Errorf ("unexpected condition status for %s on subscription %s" , v1alpha1 .SubscriptionBundleUnpackFailed , subName )
2854
+ if cond := fetched .Status .GetCondition (operatorsv1alpha1 .SubscriptionBundleUnpackFailed ); cond .Status == corev1 .ConditionTrue {
2855
+ return fmt .Errorf ("unexpected condition status for %s on subscription %s" , operatorsv1alpha1 .SubscriptionBundleUnpackFailed , subName )
2854
2856
}
2855
2857
return nil
2856
2858
}).Should (Succeed ())
@@ -3396,6 +3398,7 @@ func waitForSubscriptionToDelete(namespace, name string, c versioned.Interface)
3396
3398
}
3397
3399
3398
3400
func checkDeploymentHasPodConfigNodeSelector (t GinkgoTInterface , client operatorclient.ClientInterface , csv * operatorsv1alpha1.ClusterServiceVersion , nodeSelector map [string ]string ) error {
3401
+
3399
3402
resolver := install.StrategyResolver {}
3400
3403
3401
3404
strategy , err := resolver .UnmarshalStrategy (csv .Spec .InstallStrategy )
0 commit comments