-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(cloudprovider/exteranlgrpc): properly handle unimplemented methods #5937
fix(cloudprovider/exteranlgrpc): properly handle unimplemented methods #5937
Conversation
0c1749c
to
ead5dc9
Compare
cluster-autoscaler/cloudprovider/externalgrpc/externalgrpc_cloud_provider.go
Show resolved
Hide resolved
keeping this on draft until #5936 is merged so to cleanly regenerate the code for the protobuf. |
ead5dc9
to
59df332
Compare
after merging #5936, this is now ready to be reviewed, tagging @vadasambar as you expressed interest on this part of the code and i am the only one listed (informally, commented out) on the OWNERS file for this cloud provider. |
@@ -41,13 +41,13 @@ service CloudProvider { | |||
|
|||
// PricingNodePrice returns a theoretical minimum price of running a node for | |||
// a given period of time on a perfectly matching machine. | |||
// Implementation optional. | |||
// Implementation optional: if so should return error code 12 Unimplemented |
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.
nit: the wording feels a little ambiguous. Here's a suggestion:
// Implementation optional: if so should return error code 12 Unimplemented | |
// Implementation optional: if unimplemented return error code 12 (for `Unimplemented`) |
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.
ok, suggestion accepted
Overall looks good. I will do another pass and approve it. |
/assign vadasambar |
59df332
to
436a8a0
Compare
/lgtm |
/approve @dbonfigli Did you think about becoming k8s org member so you can approve changes for externalgrpc? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dbonfigli, vadasambar, x13n The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
If you are willing to sponsor me and we find another reviewer that wants to sponsor me I am willing to keep contributing to this project as an official k8s org member. |
Happy to do so! If you don't have another sponsor you could ask on the SIG meeting. |
Added it to the agenda for Monday: https://docs.google.com/document/d/1RvhQAEIrVLHbyNnuaT99-6u9ZUMp7BfkPupT2LAZK7w/edit#bookmark=id.xtfu11692zyn |
i'm happy to help with sponsoring as well, i reviewed some of the original grpc work. |
What type of PR is this?
/kind bug
/kind feature
What this PR does / why we need it:
Some
CloudProvider
andnodeGroup
methods are optional: if a cloud provider does not implemented an optional method, it should return thecloudprovider.ErrNotImplemented
error, this error is expected and the CA gracefully handles it.Currently there is no way to pass this specific error from a grpc based cloud provider: The protobuf definition incorrectly states that an rpc is optional or a grpc error will result in using defaults, but this is not correct at the moment: in case of grpc errors, the client passes a generic error that is not correctly handled by the CA, so currently all rpc must be implemented.
This PR allows grpc cloud providers to not implement optional methods: a not implemented method should pass the grpc error code 12
Unimplemented
, if so, the CA grpc client will transform this to the gocloudprovider.ErrNotImplemented
error that is then correctly handled.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: