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 2020/10/24 16:40:04 UTC

[GitHub] [apisix] Firstsawyou opened a new issue #2511: [discuss]: use fault-injection plugin to implement mock function

Firstsawyou opened a new issue #2511:
URL: https://github.com/apache/apisix/issues/2511


   ### Issue description
   
   We can add new features to the fault-injection plugin for the following reasons:
   Currently, the `fault-injection` plugin does not support custom conditions to implement the `mock` function. I think we can add the request header as a conditional judgment in the request (there may be a better way) to realize the mock function.
   E.g:
   
   ```
   "vars": [
        [ "httP_mock01", "==", " api01" ],
        [ "httP_mock02", "==", " api02" ]
   ]
   ```
   When there are multiple conditions in `vars`, they have an `or` relationship.
   If `vars` passes the verification, fault injection is performed on the request. Otherwise, no processing is done on the request. In order to maintain backward compatibility, the fault injection operation is still performed when the vars condition is not configured.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #2511: [discuss]: use fault-injection plugin to implement mock function

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2511:
URL: https://github.com/apache/apisix/issues/2511#issuecomment-716068517


   I think this feature is useful. Can we implement the `vars` in a common way? 
   
   Then this feature can be reused in different plugins.
   
   BTW, you wrote a typo, `httP_mock01` -> `http_mock01 `, is it right?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #2511: [discuss]: use fault-injection plugin to implement mock function

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #2511:
URL: https://github.com/apache/apisix/issues/2511#issuecomment-716089189


   > I think this feature is useful. Can we implement the `vars` in a common way?
   > 
   > Then this feature can be reused in different plugins.
   > 
   > BTW, you made a typo, `httP_mock01` -> `http_mock01 `, is it right?
   
   Thank you for your suggestion, I think it is achievable, I can try it.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #2511: [discuss]: use fault-injection plugin to implement mock function

Posted by GitBox <gi...@apache.org>.
membphis closed issue #2511:
URL: https://github.com/apache/apisix/issues/2511


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #2511: [discuss]: use fault-injection plugin to implement mock function

Posted by GitBox <gi...@apache.org>.
membphis closed issue #2511:
URL: https://github.com/apache/apisix/issues/2511


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix] membphis edited a comment on issue #2511: [discuss]: use fault-injection plugin to implement mock function

Posted by GitBox <gi...@apache.org>.
membphis edited a comment on issue #2511:
URL: https://github.com/apache/apisix/issues/2511#issuecomment-716068517


   I think this feature is useful. Can we implement the `vars` in a common way? 
   
   Then this feature can be reused in different plugins.
   
   BTW, you made a typo, `httP_mock01` -> `http_mock01 `, is it right?


----------------------------------------------------------------
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:
users@infra.apache.org