-
Notifications
You must be signed in to change notification settings - Fork 361
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
feat: add egctl ratelimit config support #2674
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2674 +/- ##
==========================================
- Coverage 63.38% 62.98% -0.41%
==========================================
Files 119 122 +3
Lines 19098 19756 +658
==========================================
+ Hits 12106 12443 +337
- Misses 6193 6506 +313
- Partials 799 807 +8 ☔ View full report in Codecov by Sentry. |
faed6ce
to
5da05ef
Compare
Signed-off-by: ShyunnY <[email protected]>
@@ -35,6 +36,10 @@ func newConfigCommand() *cobra.Command { | |||
return cfgCommand | |||
} | |||
|
|||
func ratelimitCommand() *cobra.Command { |
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.
why not use ratelimitConfigCommand
directly?
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 have thought about this problem, but I hope to write it like the func proxyCommand()
function for backward compatibility.
Signed-off-by: ShyunnY <[email protected]>
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 works @ShyunnY, add some minor comments. Also, CI need to fix.
I've test this command on my local env, and it works as expected, thanks!
@shawnh2 Thank you for your suggestions on this PR ❤️ , I have modified it. But I don’t quite understand why CI test will produce errors. Is this my problem? |
expectErr error | ||
}{ | ||
{ | ||
caseName: "normally obtain the rate limit pod of Running phase", |
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.
the log shows there's something wrong with this test case: https://github.com/envoyproxy/gateway/actions/runs/8047676612/job/21977431309?pr=2674#step:4:144.
seems the conditions in this status also needs to be updated according to checkRateLimitPodStatusReady
tc := tc | ||
t.Run(tc.name, func(t *testing.T) { | ||
got := LabelSelector() | ||
require.Equal(t, tc.expected, got) |
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.
better go with require.ElementsMatch
, since we only can promise the values of got
as expected not the orders.
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.
Okay, do I only need to change these two things?
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.
let's give it a try now
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.
It seems to be okay this time 😃
Signed-off-by: ShyunnY <[email protected]>
/retest |
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.
LGTM, thanks!
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.
LGTM thanks !
What type of PR is this?
feat(egctl): add egctl ratelimit config support
What this PR does / why we need it:
Add the
egctl ratelimit
subcommand toegctl
. This subcommand can help developers or users quickly view the ratelimit configuration or debug the ratelimit.Which issue(s) this PR fixes:
Fixes #2584