Skip to content

Commit

Permalink
Invalid Interval
Browse files Browse the repository at this point in the history
Signed-off-by: Dhriti Shikhar <dhriti.shikhar.rokz@gmail.com>
  • Loading branch information
DhritiShikhar committed Aug 31, 2021
1 parent 455975c commit 0ce9dff
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
17 changes: 13 additions & 4 deletions pkg/controller/operators/catalog/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,19 @@ func (o *Operator) syncRegistryServer(logger *logrus.Entry, in *v1alpha1.Catalog

// requeue the catalog sync based on the polling interval, for accurate syncs of catalogs with polling enabled
if out.Spec.UpdateStrategy != nil {
logger.Debugf("requeuing registry server sync based on polling interval %s", out.Spec.UpdateStrategy.Interval.Duration.String())
resyncPeriod := reconciler.SyncRegistryUpdateInterval(out, time.Now())
o.catsrcQueueSet.RequeueAfter(out.GetNamespace(), out.GetName(), queueinformer.ResyncWithJitter(resyncPeriod, 0.1)())
return
if out.Spec.UpdateStrategy.RegistryPoll != nil {
if out.Spec.UpdateStrategy.RegistryPoll.Interval.Duration == queueinformer.DefaultResyncPeriod && out.Spec.UpdateStrategy.RegistryPoll.ParsingError != nil {
out.SetError(v1alpha1.CatalogSourceIntervalInvalidError, out.Spec.UpdateStrategy.RegistryPoll.ParsingError)
if _, err := o.client.OperatorsV1alpha1().CatalogSources(out.GetNamespace()).Update(context.TODO(), out, metav1.UpdateOptions{}); err != nil {
logger.Errorf("error while setting catalogsource interval - %v", err)
return
}
}
logger.Debugf("requeuing registry server sync based on polling interval %s", out.Spec.UpdateStrategy.Interval.Duration.String())
resyncPeriod := reconciler.SyncRegistryUpdateInterval(out, time.Now())
o.catsrcQueueSet.RequeueAfter(out.GetNamespace(), out.GetName(), queueinformer.ResyncWithJitter(resyncPeriod, 0.1)())
return
}
}

if err := o.sources.Remove(sourceKey); err != nil {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ce9dff

Please sign in to comment.