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

Add RateLimit config to serviceDefaults #2844

Merged
merged 12 commits into from
Sep 5, 2023
Merged

Add RateLimit config to serviceDefaults #2844

merged 12 commits into from
Sep 5, 2023

Conversation

kisunji
Copy link
Contributor

@kisunji kisunji commented Aug 25, 2023

Changes proposed in this PR:

How I've tested this PR:

  • Added unit tests

How I expect reviewers to test this PR:

Checklist:

@kisunji kisunji added the pr/no-backport signals that a PR will not contain a backport label label Aug 28, 2023
@lkysow
Copy link
Member

lkysow commented Aug 28, 2023

Just a driveby but I think we used to also try and exercise new fields in our acceptance tests?

Copy link
Contributor

@cthain cthain left a 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.

@wilkermichael
Copy link
Contributor

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?

@kisunji
Copy link
Contributor Author

kisunji commented Aug 29, 2023

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

Copy link
Contributor

@wilkermichael wilkermichael left a 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)
Copy link
Contributor

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 🤷

.changelog/2844.txt Outdated Show resolved Hide resolved
control-plane/api/v1alpha1/servicedefaults_types.go Outdated Show resolved Hide resolved
@wilkermichael
Copy link
Contributor

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

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.

Copy link
Contributor

@wilkermichael wilkermichael left a 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!

@kisunji kisunji enabled auto-merge (squash) September 5, 2023 19:19
@kisunji kisunji force-pushed the kisunji/NET-5456 branch 3 times, most recently from bc0b814 to f2c569d Compare September 5, 2023 20:17
@kisunji kisunji merged commit c6b703d into main Sep 5, 2023
@kisunji kisunji deleted the kisunji/NET-5456 branch September 5, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport signals that a PR will not contain a backport label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants