Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Requeue request every three hours for sync
Signed-off-by: Daniel Fan <[email protected]>
  • Loading branch information
Daniel-Fan committed Apr 5, 2024
commit 8fe3613ee2cd37f859882e381e16fd1a907e102b
6 changes: 3 additions & 3 deletions controllers/operatorconfig/operatorconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
Namespace: registry.Namespace,
}, config); err != nil {
if client.IgnoreNotFound(err) != nil {
return ctrl.Result{}, client.IgnoreNotFound(err)
return ctrl.Result{}, err
} else {
klog.Infof("OperatorConfig %s/%s does not exist for oeprand %s in request %s, %s", registry.Namespace, operator.OperatorConfig, operator.Name, instance.Namespace, instance.Name)
klog.Infof("OperatorConfig %s/%s does not exist for operand %s in request %s, %s", registry.Namespace, operator.OperatorConfig, operator.Name, instance.Namespace, instance.Name)
continue
}
}
Expand All @@ -127,7 +127,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
}
}
klog.Infof("Finished reconciling OperatorConfig for request: %s, %s", instance.Namespace, instance.Name)
return ctrl.Result{}, nil
return ctrl.Result{RequeueAfter: constant.DefaultSyncPeriod}, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to requeue if reconcile was successful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason is to check if the changes made in CSV was reverted back to original state by OLM, or in the case that CSV was updated to a new version, so ODLM could have the chance to re-apply the settings every three hours.

The most ideal way is to watch CSVs proactively, but it would cause OOM possibly in All Namespace mode if we did not handle the cache properly.....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Yea, we will need more complex way of handling the CSV caching in the next release.

}

func (r *Reconciler) configCsv(ctx context.Context, csv *olmv1alpha1.ClusterServiceVersion, config *operatorv1alpha1.ServiceOperatorConfig) error {
Expand Down