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/08/27 08:34:03 UTC

[GitHub] [apisix-ingress-controller] hesamhamdarsi commented on issue #1254: bug: Restrictions for users(consumers) who are defined in namespaces that include hyphen(-) in their name do not work

hesamhamdarsi commented on issue #1254:
URL: https://github.com/apache/apisix-ingress-controller/issues/1254#issuecomment-1229150987

   Hi again,
   
   The scenario @AlinsRan is shared have a section where all "-" will be replaced by "_" (in apisixConsumer probably because of the tracking consumers to they key, user/pass, etc) and then you injected this automatically in your unit test. 
   https://sourcegraph.com/github.com/apache/apisix-ingress-controller@master/-/blob/pkg/types/apisix/v1/types.go?L538#tab=references
   So in your unit test, the namespace format is automatically aaa_bbb, while in reality we have to manually specify the namespace.
   if you want to have a real test case, I suggest using statically defined namespace in apisixRoute test. 
   
   so instead of this test case:
   ```yaml
   plugins:
      - name: consumer-restriction
        enable: true
        config:
          whitelist:
          - "%s"
   ```
   use this one manually (like in real scenario) and see if it works:
   ```yaml
   plugins:
      - name: consumer-restriction
        enable: true
        config:
          whitelist:
          - ingress-apisix-e2e-tests-xxx-xxx_ jack1
    ```


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