AlinsRan commented on code in PR #1022:
URL:
https://github.com/apache/apisix-ingress-controller/pull/1022#discussion_r883210663
##########
pkg/ingress/apisix_cluster_config.go:
##########
@@ -277,3 +277,21 @@ func (c *apisixClusterConfigController) onDelete(obj
interface{}) {
c.controller.MetricsCollector.IncrEvents("clusterConfig", "delete")
}
+
+func (c *apisixClusterConfigController) ResourceSync() {
+ objs := c.controller.apisixClusterConfigInformer.GetIndexer().List()
+ for _, obj := range objs {
+ key, err := cache.MetaNamespaceKeyFunc(obj)
+ if err != nil {
+ log.Errorf("ApisixClusterConfig sync failed, found
ApisixClusterConfig resource with bad meta namespace key: %s", err)
+ continue
+ }
+ if !c.controller.isWatchingNamespace(key) {
+ continue
+ }
+ c.workqueue.Add(&types.Event{
+ Type: types.EventAdd,
Review Comment:
* If ` types.Eventupdate `, the controller needs to compare with the old
objects during processing, which does not take effect in `ApisixRoute`
`ApisixUpstream`, and the logic needs to be modified.
* For example, the object of apifix is deleted manually, or the resource
conversion fails. The semantics is equivalent to retry. I think it is
appropriate to use `types.EventAdd`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]