[oadp-1.6] OADP-8085: fix(gcp): use errors.Is/As for GCS bucket not-found checks#2256
Conversation
cloud.google.com/go/storage PR#11519 changed bucket.Attrs() to wrap
ErrBucketNotExist around the underlying *googleapi.Error using
fmt.Errorf("%w: %w", ...), breaking direct == comparisons and type
assertions.
- Add isBucketNotFoundError helper using errors.Is/errors.As to cover
the sentinel, any wrapped form, and bare *googleapi.Error 404
- Use isBucketNotFoundError in Exists() and Delete()
- Replace type assertions with errors.As in isGCSRetryableError and
handleGCSError; replace == with errors.Is for ErrBucketNotExist
- Rename local 'errors' channel to 'errs' in deleteObjectsConcurrently
to fix revive import-shadowing lint failure
- Add TestIsBucketNotFoundError covering all wrapped-error scenarios
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: OADP-8085 DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/retest |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: openshift-cherrypick-robot, shubham-pampattiwar, sseago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@openshift-cherrypick-robot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
/hold Revision 7f8b0d7 was retested 3 times: holding |
This is an automated cherry-pick of #2233
/assign PrasadJoshi12