-
Notifications
You must be signed in to change notification settings - Fork 145
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
Properly unwrap gce-compute error code. #1708
Conversation
|
Welcome @hime! |
Hi @hime. Thanks for your PR. I'm waiting for a kubernetes-sigs 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-sigs/prow repository. |
/ok-to-test |
5c73d4b
to
9c6fea5
Compare
/test pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration |
Please add a release not -- it will make backporting of this change a lot easier. Thanks! |
/test pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amacaskill, hime 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 |
/cherry-pick release-1.13 |
/cherry-pick release-1.12 |
@hime: #1708 failed to apply on top of branch "release-1.13":
In response to this:
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-sigs/prow repository. |
@hime: #1708 failed to apply on top of branch "release-1.12":
In response to this:
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-sigs/prow repository. |
…tream-release-1.12 Automated cherry pick of #1708: Properly unwrap gce-compute error code.
What type of PR is this?
/kind bug
What this PR does / why we need it:
A new way of wrapping errors was introduced in compute engine API (eg. "cloud.service.Disks.Insert") where some of these errors are wrapped with an additional layer of googleapi.Error. This additional wrap does not contain the http error code in its error code field, but instead contains a default value of Unknown. This is problematic because one of the ways we extract errors is by checking if the error can be a status (signifying a temporary error instead). The way the error is structured allows it to be classified as temporary, which causes our code to return the Unknown error present in the outermost layer, before any other error checks occur.
This has been causing issues in how we report errors coming from compute engine, since we do not currently unwrap them properly, resulting in
Unknown
error code being reported in most scenarios. This PR ensures we are unwrapping the embedded error code properly while making sure all the other error types we encounter continue to process errors as expected.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: