Skip to content

Add RateLimit config to serviceDefaults#2844

Merged
kisunji merged 12 commits intomainfrom
kisunji/NET-5456
Sep 5, 2023
Merged

Add RateLimit config to serviceDefaults#2844
kisunji merged 12 commits intomainfrom
kisunji/NET-5456

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
Contributor

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.

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 🤷

@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