Skip to content

Make gRPC service structs forward-compatible by embedding Unimplemented.. types #987

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

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

misberner
Copy link
Contributor

gRPC code generation generates Unimplemented... structs that return an unimplemented status code for all methods. This struct should be embedded in all gRPC service implementations. While this is not currently enforced, future gRPC code generator versions will make this mandatory (this behavior can be disabled, but it is not recommended; see here for a lengthy discussion on this matter with the clear verdict that gRPC authors see embedding of Unimplemented.. as something that should always have been required).

Alas, this makes service type assertions ineffective, but that seems to be the pill to swallow.

(description copied from stackrox/stackrox#3538)

@misberner misberner requested a review from RTann October 24, 2022 20:01
Copy link
Collaborator

@RTann RTann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird we have to embed an Unimplemented... struct into our implementation of the interface but ok

@ghost
Copy link

ghost commented Oct 24, 2022

Images are ready for the commit at d2b5502.

To use the images, use the tag 2.26.x-6-gd2b55026f6.

@openshift-ci
Copy link

openshift-ci bot commented Oct 24, 2022

@misberner: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-tests d2b5502 link false /test e2e-tests

Full PR test history. Your PR dashboard.

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.

@misberner
Copy link
Contributor Author

@RTann the E2E failures seem unrelated, amiright?

@RTann
Copy link
Collaborator

RTann commented Oct 24, 2022

@RTann the E2E failures seem unrelated, amiright?

yeah, you can ignore it. This package has gotten quite a few vuln updates lately

@misberner misberner merged commit 1d892fb into master Oct 24, 2022
@misberner misberner deleted the mi/embed-unimplemented-grpc branch October 24, 2022 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants