@@ -1146,12 +1146,14 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1146
1146
1147
1147
})
1148
1148
1149
- When ("A catalogSource is created with incorrect interval" , func () {
1149
+ FWhen ("A catalogSource is created with incorrect interval" , func () {
1150
1150
1151
- var source * v1alpha1.CatalogSource
1151
+ var (
1152
+ source * v1alpha1.CatalogSource
1153
+ sourceName = genName ("catalog-" )
1154
+ )
1152
1155
1153
1156
BeforeEach (func () {
1154
- sourceName := genName ("catalog-" )
1155
1157
source = & v1alpha1.CatalogSource {
1156
1158
TypeMeta : metav1.TypeMeta {
1157
1159
Kind : v1alpha1 .CatalogSourceKind ,
@@ -1189,6 +1191,33 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1189
1191
}
1190
1192
return false
1191
1193
}).Should (BeTrue ())
1194
+
1195
+ When ("the catalogsource is updated with a valid polling interval" , func () {
1196
+ BeforeEach (func () {
1197
+ catsrc , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .TODO (), source .GetName (), metav1.GetOptions {})
1198
+ Expect (err ).ToNot (HaveOccurred ())
1199
+ catsrc .Spec .UpdateStrategy .RegistryPoll .RawInterval = "45m"
1200
+ _ , err = crc .OperatorsV1alpha1 ().CatalogSources (catsrc .GetNamespace ()).Update (context .TODO (), catsrc , metav1.UpdateOptions {})
1201
+ Expect (err ).ToNot (HaveOccurred ())
1202
+ })
1203
+ It ("the catalogsource spec shows the updated polling interval, and the error message in the status is cleared" , func () {
1204
+ Eventually (func () error {
1205
+ catsrc , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .TODO (), source .GetName (), metav1.GetOptions {})
1206
+ if err != nil {
1207
+ return err
1208
+ }
1209
+ expectedTime , err := time .ParseDuration ("45m" )
1210
+ if err != nil {
1211
+ return err
1212
+ }
1213
+ if catsrc .Status .Reason != "" || (catsrc .Spec .UpdateStrategy .Interval != & metav1.Duration {expectedTime }) {
1214
+ return err
1215
+ }
1216
+ return nil
1217
+
1218
+ }).Should (Succeed ())
1219
+ })
1220
+ })
1192
1221
})
1193
1222
})
1194
1223
0 commit comments