tokers commented on a change in pull request #176:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/176#discussion_r560713624



##########
File path: pkg/seven/state/builder.go
##########
@@ -227,64 +221,18 @@ func SolverSingleUpstream(u *v1.Upstream, swg 
ServiceWorkerGroup, wg *sync.WaitG
                                                needToUpdate = false
                                        }
                                }
-                               if needToUpdate {
-                                       // 1.sync memDB
-                                       upstreamDB := &db.UpstreamDB{Upstreams: 
[]*v1.Upstream{u}}
-                                       if err := upstreamDB.UpdateUpstreams(); 
err != nil {
-                                               log.Errorf("solver upstream 
failed, update upstream to local db failed, err: %s", err.Error())
-                                               errNotify = err
-                                               return
-                                       }
-
-                                       // 2.sync apisix
-                                       var cluster string
-                                       if u.Group != nil {
-                                               cluster = *u.Group
-                                       }
+                               if needToUpdate || (u.FromKind != nil && 
*u.FromKind == WatchFromKind) {

Review comment:
       Fixed.

##########
File path: pkg/apisix/route.go
##########
@@ -48,9 +48,17 @@ func newRouteClient(c *cluster) Route {
        }
 }
 
+// Get only looks up the cache, it's not necessary to access APISIX, since all 
resources
+// are created by Create, which reflects the change to cache in turn, so if 
resource
+// is not in cache, it's not in APISIX either.
+func (r *routeClient) Get(_ context.Context, fullname string) (*v1.Route, 
error) {
+       return r.cluster.cache.GetRoute(fullname)

Review comment:
       Added.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to