@@ -201,12 +201,17 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
201
201
202
202
installPlanName := subscription .Status .Install .Name
203
203
requiresApprovalChecker := buildInstallPlanPhaseCheckFunc (v1alpha1 .InstallPlanPhaseRequiresApproval )
204
- fetchedInstallPlan , err := fetchInstallPlanWithNamespace (GinkgoT (), crc , installPlanName , ns .GetName (), requiresApprovalChecker )
205
- Expect (err ).ShouldNot (HaveOccurred ())
206
204
207
- fetchedInstallPlan .Spec .Approved = true
208
- _ , err = crc .OperatorsV1alpha1 ().InstallPlans (ns .GetName ()).Update (context .Background (), fetchedInstallPlan , metav1.UpdateOptions {})
209
- Expect (err ).ShouldNot (HaveOccurred ())
205
+ Eventually (func () error {
206
+ fetchedInstallPlan , err := fetchInstallPlanWithNamespace (GinkgoT (), crc , installPlanName , ns .GetName (), requiresApprovalChecker )
207
+ if err != nil {
208
+ return err
209
+ }
210
+
211
+ fetchedInstallPlan .Spec .Approved = true
212
+ _ , err = crc .OperatorsV1alpha1 ().InstallPlans (ns .GetName ()).Update (context .Background (), fetchedInstallPlan , metav1.UpdateOptions {})
213
+ return err
214
+ }).Should (Succeed ())
210
215
211
216
_ , err = awaitCSV (crc , ns .GetName (), mainCSV .GetName (), csvSucceededChecker )
212
217
Expect (err ).ShouldNot (HaveOccurred ())
@@ -592,11 +597,16 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
592
597
Expect (err ).ShouldNot (HaveOccurred ())
593
598
594
599
// Update the catalog's address to point at the other registry pod's cluster ip
595
- addressSource , err = crc .OperatorsV1alpha1 ().CatalogSources (ns .GetName ()).Get (context .Background (), addressSourceName , metav1.GetOptions {})
596
- Expect (err ).ShouldNot (HaveOccurred ())
597
- addressSource .Spec .Address = net .JoinHostPort (replacementCopy .Status .PodIP , "50051" )
598
- _ , err = crc .OperatorsV1alpha1 ().CatalogSources (ns .GetName ()).Update (context .Background (), addressSource , metav1.UpdateOptions {})
599
- Expect (err ).ShouldNot (HaveOccurred ())
600
+ Eventually (func () error {
601
+ addressSource , err = crc .OperatorsV1alpha1 ().CatalogSources (ns .GetName ()).Get (context .Background (), addressSourceName , metav1.GetOptions {})
602
+ if err != nil {
603
+ return err
604
+ }
605
+
606
+ addressSource .Spec .Address = net .JoinHostPort (replacementCopy .Status .PodIP , "50051" )
607
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (ns .GetName ()).Update (context .Background (), addressSource , metav1.UpdateOptions {})
608
+ return err
609
+ }).Should (Succeed ())
600
610
601
611
// Wait for the replacement CSV to be installed
602
612
_ , err = awaitCSV (crc , ns .GetName (), replacementCSV .GetName (), csvSucceededChecker )
@@ -892,12 +902,17 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
892
902
}
893
903
894
904
// update catalog source with annotation (to kick resync)
895
- source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
896
- Expect (err ).ShouldNot (HaveOccurred (), "error awaiting registry pod" )
897
- source .Annotations = make (map [string ]string )
898
- source .Annotations ["testKey" ] = "testValue"
899
- _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
900
- Expect (err ).ShouldNot (HaveOccurred (), "error awaiting registry pod" )
905
+ Eventually (func () error {
906
+ source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
907
+ if err != nil {
908
+ return nil
909
+ }
910
+
911
+ source .Annotations = make (map [string ]string )
912
+ source .Annotations ["testKey" ] = "testValue"
913
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
914
+ return err
915
+ }).Should (Succeed ())
901
916
902
917
time .Sleep (11 * time .Second )
903
918
@@ -916,11 +931,17 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
916
931
}
917
932
}
918
933
// update catalog source with annotation (to kick resync)
919
- source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
920
- Expect (err ).ShouldNot (HaveOccurred (), "error getting catalog source pod" )
921
- source .Annotations ["testKey" ] = genName ("newValue" )
922
- _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
923
- Expect (err ).ShouldNot (HaveOccurred (), "error updating catalog source pod with test annotation" )
934
+ Eventually (func () error {
935
+ source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
936
+ if err != nil {
937
+ return err
938
+ }
939
+
940
+ source .Annotations ["testKey" ] = genName ("newValue" )
941
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
942
+ return err
943
+ }).Should (Succeed ())
944
+
924
945
return false
925
946
}
926
947
// await new catalog source and ensure old one was deleted
@@ -930,11 +951,16 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
930
951
Expect (registryPods .Items ).To (HaveLen (1 ), "unexpected number of registry pods found" )
931
952
932
953
// update catalog source with annotation (to kick resync)
933
- source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
934
- Expect (err ).ShouldNot (HaveOccurred (), "error awaiting registry pod" )
935
- source .Annotations ["testKey" ] = "newValue"
936
- _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
937
- Expect (err ).ShouldNot (HaveOccurred (), "error awaiting registry pod" )
954
+ Eventually (func () error {
955
+ source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
956
+ if err != nil {
957
+ return err
958
+ }
959
+
960
+ source .Annotations ["testKey" ] = "newValue"
961
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), source , metav1.UpdateOptions {})
962
+ return err
963
+ }).Should (Succeed ())
938
964
939
965
subChecker := func (sub * v1alpha1.Subscription ) bool {
940
966
return sub .Status .InstalledCSV == "busybox.v2.0.0"
@@ -1030,19 +1056,16 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1030
1056
Expect (subscription .Status .InstalledCSV ).To (Equal ("busybox-dependency.v1.0.0" ))
1031
1057
1032
1058
// Update the catalog image
1033
- Eventually (func () ( bool , error ) {
1059
+ Eventually (func () error {
1034
1060
existingSource , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), sourceName , metav1.GetOptions {})
1035
1061
if err != nil {
1036
- return false , err
1062
+ return err
1037
1063
}
1038
1064
existingSource .Spec .Image = catSrcImage + ":2.0.0-with-ListBundles-method"
1039
1065
1040
1066
source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Update (context .Background (), existingSource , metav1.UpdateOptions {})
1041
- if err == nil {
1042
- return true , nil
1043
- }
1044
- return false , nil
1045
- }).Should (BeTrue ())
1067
+ return err
1068
+ }).Should (Succeed ())
1046
1069
1047
1070
// Wait for the CatalogSource to be ready
1048
1071
_ , err = fetchCatalogSourceOnStatus (crc , source .GetName (), source .GetNamespace (), catalogSourceRegistryPodSynced )
@@ -1201,11 +1224,15 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1201
1224
})
1202
1225
When ("the catalogsource is updated with a valid polling interval" , func () {
1203
1226
BeforeEach (func () {
1204
- catsrc , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .TODO (), source .GetName (), metav1.GetOptions {})
1205
- Expect (err ).ToNot (HaveOccurred ())
1206
- catsrc .Spec .UpdateStrategy .RegistryPoll .RawInterval = correctInterval
1207
- _ , err = crc .OperatorsV1alpha1 ().CatalogSources (catsrc .GetNamespace ()).Update (context .TODO (), catsrc , metav1.UpdateOptions {})
1208
- Expect (err ).ToNot (HaveOccurred ())
1227
+ Eventually (func () error {
1228
+ catsrc , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .TODO (), source .GetName (), metav1.GetOptions {})
1229
+ if err != nil {
1230
+ return err
1231
+ }
1232
+ catsrc .Spec .UpdateStrategy .RegistryPoll .RawInterval = correctInterval
1233
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (catsrc .GetNamespace ()).Update (context .TODO (), catsrc , metav1.UpdateOptions {})
1234
+ return err
1235
+ }).Should (Succeed ())
1209
1236
})
1210
1237
It ("the catalogsource spec shows the updated polling interval, and the error message in the status is cleared" , func () {
1211
1238
Eventually (func () error {
0 commit comments