@@ -1148,10 +1148,12 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
11481148
11491149 When ("A catalogSource is created with incorrect interval" , func () {
11501150
1151- var source * v1alpha1.CatalogSource
1151+ var (
1152+ source * v1alpha1.CatalogSource
1153+ sourceName = genName ("catalog-" )
1154+ )
11521155
11531156 BeforeEach (func () {
1154- sourceName := genName ("catalog-" )
11551157 source = & v1alpha1.CatalogSource {
11561158 TypeMeta : metav1.TypeMeta {
11571159 Kind : v1alpha1 .CatalogSourceKind ,
@@ -1189,6 +1191,33 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
11891191 }
11901192 return false
11911193 }).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+ })
11921221 })
11931222 })
11941223
0 commit comments