-
Notifications
You must be signed in to change notification settings - Fork 204
Add 404: ResourceError
handling in sdkFind
#421
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
Conversation
@@ -34,6 +34,9 @@ func (rm *resourceManager) sdkFind( | |||
{{- end }} | |||
rm.metrics.RecordAPICall("READ_ONE", "{{ .CRD.Ops.ReadOne.ExportedName }}", err) | |||
if err != nil { | |||
if reqErr, ok := ackerr.AWSRequestFailure(err); ok && reqErr.StatusCode() == 404 { | |||
return nil, ackerr.NotFound | |||
+ } |
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.
+ 👀
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.
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.
i meant + 👁️ , there is a tiny extra character in the last line :)
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.
Intentation is correct, but there was a little +
copied from my git patch
foo, well spotted @a-hilaly !
Signed-off-by: Michael Gasch <[email protected]>
@embano1: The following test failed, say
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. |
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.
It's funny that AWSRequestFailure
already exists in runtime :)
Looks good to me! We can force merge as the prow errors are not related to this change.
Danke Michael!
Can someone please force-merge to get this PR closed :) 🙏🏻 |
404
ResourceError` handling in sdkFind404: ResourceError
handling in sdkFind
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, embano1, jljaco, RedbackThomson 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 |
In the
Pipes
service controller we noticed that the error returned from the API is of typeRequestFailure
. A workaround is to setcode: ""
ingenerator.yaml
or for those not aware of this issue fallback using this new type assertion inREAD_ONE
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.