Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handles incorrect CatalogSource interval values. #2294

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.