Skip to content

Commit

Permalink
Update templates with new ratelimit configuration (envoyproxy#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccaraman authored Jan 11, 2017
1 parent bcdb68b commit c0deb5b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
15 changes: 11 additions & 4 deletions configs/envoy_service_to_service.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@
{
"prefix": "/",
{{ helper.make_route_internal(service, options) }}
{% if options.get('service_to_service_rate_limit', False) %}
,
"rate_limits":[
{
"actions": [
{"type": "service_to_service"}
]
}
]
{% endif %}
}
]
}{% if not loop.last %},{% endif -%}
Expand All @@ -139,10 +149,7 @@
"filters": [
{"type": "decoder", "name": "rate_limit",
"config": {
"domain": "envoy_service_to_service",
"actions": [
{"type": "service_to_service"}
]
"domain": "envoy_service_to_service"
}
},
{"type": "both", "name": "grpc_http1_bridge", "config": {}},
Expand Down
5 changes: 0 additions & 5 deletions configs/routing_helper.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
"retry_policy": {
"retry_on": "{{ options.get('retry_on', 'connect-failure') }}"
},
{% if 'global_rate_limit' in options %}
"rate_limit": {
"global": true
},
{% endif %}
"cluster": "{{ cluster }}"
{% endmacro %}

Expand Down
30 changes: 16 additions & 14 deletions test/config/integration/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@
{
"prefix": "/test/long/url",
"cluster": "cluster_1",
"rate_limit": {
"global": true
}
"rate_limits": [
{
"actions": [
{"type": "service_to_service"}
]
}
]
},
{
"prefix": "/test/",
Expand All @@ -83,10 +87,7 @@
},
{ "type": "decoder", "name": "rate_limit",
"config": {
"domain": "foo",
"actions": [
{"type": "service_to_service"}
]
"domain": "foo"
}
},
{ "type": "decoder", "name": "router", "config": {} }
Expand Down Expand Up @@ -144,9 +145,13 @@
{
"prefix": "/test/long/url",
"cluster": "cluster_1",
"rate_limit": {
"global": true
}
"rate_limits": [
{
"actions": [
{"type": "service_to_service"}
]
}
]
},
{
"prefix": "/test/",
Expand All @@ -164,10 +169,7 @@
},
{ "type": "decoder", "name": "rate_limit",
"config": {
"domain": "foo",
"actions": [
{"type": "service_to_service"}
]
"domain": "foo"
}
},
{ "type": "decoder", "name": "buffer",
Expand Down

0 comments on commit c0deb5b

Please sign in to comment.