You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/16 07:24:03 UTC

[GitHub] [apisix-ingress-controller] Phoebus888 opened a new issue, #1532: crd是否支持filter_func自定义函数添加

Phoebus888 opened a new issue, #1532:
URL: https://github.com/apache/apisix-ingress-controller/issues/1532

   ### Issue description
   
   我们需要基于 Body 里面某个参数的值来路由,即不同的值要转发到不同的后端 IP:PORT,自带的插件traffic-split只支持header匹配到不同后端
   
   ### Environment
   
   apisix-ingress-controller版本为1.5.0
   k8s版本为v1.20.6-tke.27


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] Phoebus888 commented on issue #1532: crd是否支持filter_func自定义函数添加

Posted by GitBox <gi...@apache.org>.
Phoebus888 commented on issue #1532:
URL: https://github.com/apache/apisix-ingress-controller/issues/1532#issuecomment-1354326212

   配置规则为
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: method-route
     namespace: middle-platform-uat
   spec:
     http:
       - name: method
         match:
           filter_func: "function(vars)\n  local core = require ('apisix.core')\n  local body, err = core.request.get_body()\n  if not body then\n      return false\n  end\n\n  local data, err = core.json.decode(body)\n  if not data then\n      return false\n  end\n\n  if data['foo'] == 'bar' then\n      return true\n  end\n\n  return false\nend"
           hosts:
           - test.01lb.vip
           paths:
             - /*
           exprs:
             - subject:
                 scope: Header
                 name: User-Agent
               op: RegexMatch
               value: ".*dev.*"
         backends:
           - serviceName: mp-outer-gateway
             servicePort: 8080
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1532: feature request: support filter_func for ApisixRoute

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1532:
URL: https://github.com/apache/apisix-ingress-controller/issues/1532#issuecomment-1355170720

   Not currently supported, but it's simple enough to add this functionality.
   Are you interested in submitting a PR?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] Phoebus888 closed issue #1532: feature request: support filter_func for ApisixRoute

Posted by GitBox <gi...@apache.org>.
Phoebus888 closed issue #1532: feature request: support filter_func for ApisixRoute
URL: https://github.com/apache/apisix-ingress-controller/issues/1532


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1532: feature request: support filter_func for ApisixRoute

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1532:
URL: https://github.com/apache/apisix-ingress-controller/issues/1532#issuecomment-1357872433

   #1545 will resolve this one. Thanks @aynp


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org