-
Notifications
You must be signed in to change notification settings - Fork 345
fix(meshratelimit): add warning log about status code #13958
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
base: master
Are you sure you want to change the base?
Conversation
…n 400 Signed-off-by: Lukasz Dziedziak <[email protected]>
Reviewer Checklist🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
|
@@ -9,6 +11,35 @@ func (t *MeshRateLimitResource) Deprecations() []string { | |||
var deprecations []string | |||
if len(pointer.Deref(t.Spec.From)) > 0 { | |||
deprecations = append(deprecations, "'from' field is deprecated, use 'rules' instead") | |||
for i, rule := range pointer.Deref(t.Spec.From) { | |||
if rule.Default.Local != nil && isStatusInvalid(pointer.Deref(rule.Default.Local)) { |
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.
you don't need pointer.Deref if you just checked that rule.Default.Local
is not nil
@@ -9,6 +11,35 @@ func (t *MeshRateLimitResource) Deprecations() []string { | |||
var deprecations []string | |||
if len(pointer.Deref(t.Spec.From)) > 0 { | |||
deprecations = append(deprecations, "'from' field is deprecated, use 'rules' instead") | |||
for i, rule := range pointer.Deref(t.Spec.From) { | |||
if rule.Default.Local != nil && isStatusInvalid(pointer.Deref(rule.Default.Local)) { | |||
deprecations = append(deprecations, fmt.Sprintf("'spec.from[%d].default.local.http.requestRate.status' must be 400 or higher. Please update your configuration.", i)) |
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.
should we mention why that's the case? that envoy uses 429 when that happens?
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.
should this be in deprecations or in warnings?
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.
warnings
are not presented anywhere so it might not be a solution here
Signed-off-by: Lukasz Dziedziak <[email protected]>
Motivation
If the status is lower than 400 envoy fallback to 429. We shouldn't allow setting incorrect status
Implementation information
Added log information that setting status lower than 400 is not supported
Supporting documentation
part of: ##13319