Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set RateLimiterPolicy to 'default' or 'disable' #2284

Closed
jakebanks opened this issue Oct 19, 2023 · 2 comments
Closed

Unable to set RateLimiterPolicy to 'default' or 'disable' #2284

jakebanks opened this issue Oct 19, 2023 · 2 comments
Assignees
Labels
Type: Bug Something isn't working
Milestone

Comments

@jakebanks
Copy link
Contributor

jakebanks commented Oct 19, 2023

Describe the bug

Following the README for rate limiting I am able to successfully add a rate limiter policy customPolicy, however, when I try to disable it for a route I am getting the error RateLimiter policy 'disable' not found for route 'route1'.

I think this might be caused by the code for validating routes being unable to detect these built in policies, since the collection appears empty.

Am I doing something incorrectly here?

To Reproduce

Using config example from rate-limiting.md

"ReverseProxy": {
    "Routes": {
      "route1" : {
        "ClusterId": "cluster1",
        "Match": {
          "Hosts": ["example.pageuppeople.com"]
        },
        "RateLimiterPolicy": "disable"
      }
    },
    "Clusters": {
      "cluster1": {
        "Destinations": {
          "destination1": {
            "Address": "http://example.com/"
          }
        }
      }

or with in-application config:

 new RouteConfig
        {
            RouteId = routeId,
            ClusterId = clusterId,
            Match = new RouteMatch
            {
                Hosts = commaSeparatedHosts.Split(","),
            },
            RateLimiterPolicy = "Disable"
        };

See my draft PR here, I am happy to provide a minimal example if that is required

Further technical details

  • YARP 2.0.1
  • Windows
@jakebanks jakebanks added the Type: Bug Something isn't working label Oct 19, 2023
@MihaZupan MihaZupan added this to the YARP 2.x milestone Oct 19, 2023
@MihaZupan
Copy link
Member

Thank you for the report, the current behavior does look wrong.

@jakebanks
Copy link
Contributor Author

Solved by #2283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants