Skip to content

Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError #1232

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 1 commit into from
May 24, 2023

Conversation

amacaskill
Copy link
Member

@amacaskill amacaskill commented May 24, 2023

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug

/kind cleanup

/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:
Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError. Currently wrapped errors cannot be detected in IsGCEError. Also if we return a grpc error code that is not an error we filter out by LoggedError, it will get turned into an Internal error.
Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 24, 2023
@amacaskill
Copy link
Member Author

/assign @sunnylovestiramisu

@k8s-ci-robot k8s-ci-robot requested a review from msau42 May 24, 2023 18:40
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 24, 2023
@amacaskill amacaskill force-pushed the code-for-error branch 2 times, most recently from 90b54ae to 188f470 Compare May 24, 2023 20:50
@sunnylovestiramisu
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 24, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amacaskill, sunnylovestiramisu

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:
  • OWNERS [amacaskill,sunnylovestiramisu]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit e9f75ce into kubernetes-sigs:master May 24, 2023
@amacaskill
Copy link
Member Author

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot

@amacaskill: new pull request created: #1233

In response to this:

/cherry-pick release-1.10

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.

@sunnylovestiramisu
Copy link
Contributor

/cherry-pick release-1.9

@k8s-infra-cherrypick-robot

@sunnylovestiramisu: #1232 failed to apply on top of branch "release-1.9":

Applying: Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
Using index info to reconstruct a base tree...
M	pkg/gce-pd-csi-driver/utils.go
M	pkg/gce-pd-csi-driver/utils_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/gce-pd-csi-driver/utils_test.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils_test.go
Auto-merging pkg/gce-pd-csi-driver/utils.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.9

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.

k8s-ci-robot added a commit that referenced this pull request Jun 1, 2023
…k-of-#1150-#1232-#1227-upstream-release-1.8

Automated cherry pick of #1150: fix bug where volume cloning topology requirements are
#1232: Use errors.As so we can detect wrapped errors, and check for
#1227: Adding new metric pdcsi_operation_errors to fetch error
@judemars
Copy link
Contributor

judemars commented Aug 2, 2023

/cherry-pick release-1.8

@k8s-infra-cherrypick-robot

@judemars: #1232 failed to apply on top of branch "release-1.8":

Applying: Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
Using index info to reconstruct a base tree...
M	pkg/gce-cloud-provider/compute/gce.go
M	pkg/gce-pd-csi-driver/utils.go
M	pkg/gce-pd-csi-driver/utils_test.go
M	test/remote/instance.go
Falling back to patching base and 3-way merge...
Auto-merging test/remote/instance.go
Auto-merging pkg/gce-pd-csi-driver/utils_test.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils_test.go
Auto-merging pkg/gce-pd-csi-driver/utils.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils.go
Auto-merging pkg/gce-cloud-provider/compute/gce.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.8

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.

k8s-ci-robot added a commit that referenced this pull request Aug 4, 2023
…-upstream-release-1.7

Automated cherry pick of #1232: Use errors.As so we can detect wrapped errors, and check for
@judemars
Copy link
Contributor

/cherry-pick release-1.7

@k8s-infra-cherrypick-robot

@judemars: #1232 failed to apply on top of branch "release-1.7":

Applying: Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
Using index info to reconstruct a base tree...
M	pkg/gce-cloud-provider/compute/gce.go
M	pkg/gce-pd-csi-driver/utils.go
M	pkg/gce-pd-csi-driver/utils_test.go
M	test/remote/instance.go
Falling back to patching base and 3-way merge...
Auto-merging test/remote/instance.go
Auto-merging pkg/gce-pd-csi-driver/utils_test.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils_test.go
Auto-merging pkg/gce-pd-csi-driver/utils.go
CONFLICT (content): Merge conflict in pkg/gce-pd-csi-driver/utils.go
Auto-merging pkg/gce-cloud-provider/compute/gce.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use errors.As so we can detect wrapped errors, and check for existing error codes in CodesForError
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.7

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants