-
Notifications
You must be signed in to change notification settings - Fork 8.1k
add gRPC status in fault abort #26059
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
Conversation
Hi @ckcd. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
/ok-to-test |
pkg/config/validation/validation.go
Outdated
@@ -95,6 +97,27 @@ var ( | |||
http.MethodTrace: true, | |||
} | |||
|
|||
// golang supported gRPC status: https://github.com/grpc/grpc-go/blob/master/codes/codes.go | |||
supportedGRPCStatus = map[string]codes.Code{ |
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.
Can we remove this duplication and have these code mapping defined at a common place?
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.
any suggestion? cause I cannot find a common place or any types
dir. And the route.go(pilot/pkg/...) and validate.go(pkg/...) are in very different path.
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.
somewhere in 'pkg/util/grpc.go` ?
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.
Cool, I will do this change tomorrow, 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.
Done, please take a look.
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 but we need to decide if we want string or int. Once we implement it we cannot change
61a116a
to
23c1cec
Compare
4af88d6
to
297ef8e
Compare
/label release-notes-none |
yes it's hard to choose. But I think |
BTW seems we need a @howardjohn @ramaraochavali PTAL. |
PTAL, thanks~ |
/test integ-pilot-k8s-tests_istio |
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.
Thank you
/test release-notes_istio |
@@ -921,8 +922,13 @@ func translateFault(in *networking.HTTPFaultInjection) *xdshttpfault.HTTPFault { | |||
out.Abort.ErrorType = &xdshttpfault.FaultAbort_HttpStatus{ | |||
HttpStatus: uint32(a.HttpStatus), | |||
} | |||
case *networking.HTTPFaultInjection_Abort_GrpcStatus: | |||
code := grpcutil.SupportedGRPCStatus[a.GrpcStatus] |
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.
@ckcd What if an invalid gRPC status code is passed? Is the status code validated somewhere before the lookup?
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.
Yes it's in pkg/config/validation/validation.go
in this PR.
/test integ-pilot-multicluster-tests_istio |
@howardjohn @rshriram @linsun @costinm |
@@ -1994,6 +1994,13 @@ func validateHTTPStatus(status int32) error { | |||
return nil | |||
} | |||
|
|||
func validateGPRCStatus(status string) error { | |||
if _, ok := grpcutil.SupportedGRPCStatus[status]; !ok { |
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 suspect a user may get confused by this. Can we expand this to say something like:
gRPC status "foo" is not supported
. See https://github.com/grpc/grpc/blob/master/doc/statuscodes.md for a list of supported codes, for example "NOT_FOUND"`
This makes it clear that not_found
or 5
are not valid.
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.
Can you add this?
@ckcd: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'd like to use the fault injection for gRPC, so what's the current status of this PR? |
@ckcd: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Would be great to revive this (and add integ test at
|
Signed-off-by: su225 <suchithjn22@gmail.com>
…ault injection) (#39295) * resurrect PR - #26059 Signed-off-by: su225 <suchithjn22@gmail.com> * add gRPC status checker Signed-off-by: su225 <suchithjn22@gmail.com> * add gRPC abort integration test Signed-off-by: su225 <suchithjn22@gmail.com> * add release notes Signed-off-by: su225 <suchithjn22@gmail.com> * make linter happy * fix release notes Signed-off-by: su225 <suchithjn22@gmail.com>
Merged in #39295. Thanks! |
Implement of
grpc status
infault abort
.e.g.
The related api is in istio/api:virtual_service.proto#L1816 and for now it's
hide_from_docs
.And we discuss about whether the type of
GrpcStatus
should bestring
oruint32
in #24698. cc @howardjohn[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[X] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure