-
Notifications
You must be signed in to change notification settings - Fork 326
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
Add RateLimit config to serviceDefaults #2844
Conversation
control-plane/config/crd/bases/consul.hashicorp.com_servicedefaults.yaml
Outdated
Show resolved
Hide resolved
Just a driveby but I think we used to also try and exercise new fields in our acceptance tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Luke that we should have k8s acceptance tests for rate limiting. It seems reasonable to do that in a follow up PR.
Another drive by, haven't had a chance to fully review. But did you try creating the resource locally as part of your changes? Just to verify it exists properly in Consul? |
It's not a new resource but a field added to service-defaults. In an acceptance test I added an assertion that the field exists with the right value from the fixture yaml. I'll spend time writing a proper acceptance test eventually. I need to shift focus to some multiport/v2 work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this @kisunji, a few minor comments. I also just want to double check some of the verification logic around including 0
as a valid value.
@@ -232,8 +234,8 @@ func TestController(t *testing.T) { | |||
require.Equal(r, 100.0, rateLimitIPConfigEntry.KV.WriteRate) | |||
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.ReadRate) | |||
require.Equal(r, 100.0, rateLimitIPConfigEntry.Tenancy.WriteRate) | |||
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate) | |||
//require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.WriteRate) | |||
// require.Equal(r, 100.0, rateLimitIPConfigEntry.PreparedQuery.ReadRate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you didn't add these, but I think these should these just be removed? There's no todo comment or anything associated with them 🤷
control-plane/config/crd/bases/consul.hashicorp.com_servicedefaults.yaml
Show resolved
Hide resolved
control-plane/config/crd/bases/consul.hashicorp.com_servicedefaults.yaml
Show resolved
Hide resolved
control-plane/config/crd/bases/consul.hashicorp.com_servicedefaults.yaml
Show resolved
Hide resolved
control-plane/config/crd/bases/consul.hashicorp.com_servicedefaults.yaml
Show resolved
Hide resolved
Did you test that locally? The acceptance tests in the pipeline are currently not working, but they should work locally if you build dataplane yourself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments!
7a84bcd
to
94a0943
Compare
63562ca
to
9af8e23
Compare
Co-authored-by: Michael Wilkerson <62034708+wilkermichael@users.noreply.github.com>
bc0b814
to
f2c569d
Compare
f2c569d
to
1991391
Compare
Changes proposed in this PR:
serviceDefaults
CRD to match the addition in CE commit consul#18583How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: