Yiyiyimu commented on a change in pull request #549:
URL:
https://github.com/apache/apisix-ingress-controller/pull/549#discussion_r654977388
##########
File path: pkg/apisix/route.go
##########
@@ -41,16 +41,24 @@ func newRouteClient(c *cluster) Route {
}
// Get returns the Route.
+func (r *routeClient) Get(ctx context.Context, name string) (*v1.Route, error)
{
+ return r.get(ctx, id.GenID(name), name)
+}
+
+// GetByName returns the Route with route name
+func (r *routeClient) GetByID(ctx context.Context, realID string) (*v1.Route,
error) {
+ return r.get(ctx, realID, realID)
+}
+
// FIXME, currently if caller pass a non-existent resource, the Get always
passes
// through cache.
-func (r *routeClient) Get(ctx context.Context, name string) (*v1.Route, error)
{
+func (r *routeClient) get(ctx context.Context, id string, name string)
(*v1.Route, error) {
log.Debugw("try to look up route",
zap.String("name", name),
zap.String("url", r.url),
zap.String("cluster", "default"),
Review comment:
`GetById` also pass id as `name` in `get`.
So changed `zap.String("name", name)` to `zap.String("name/id", name)`
--
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]