Skip to content
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

aws: errors with context #1705

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

bpineau
Copy link
Contributor

@bpineau bpineau commented Aug 4, 2020

When faced with errors from cloud providers (like "Throttling: Rate exceeded"), it's not always easy to find what operation caused the failure, and what action was aborted, if any.

Let's make it easier to identify an error source (and affected object when possible) on AWS by providing more context (and by using easy to find error messages).

Checklist

  • Update changelog in CHANGELOG.md, use section "Unreleased".

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 4, 2020
@bpineau bpineau force-pushed the aws-errors-context branch 3 times, most recently from 11af9fa to 6f1bf45 Compare August 4, 2020 10:54
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2020
@tariq1890
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 13, 2020
@seanmalloy
Copy link
Member

I see that files source/store.go and provider/oci/oci.go are both using the errors.Wrap() function. But I'm curious if maybe instead the newer built in Go error wrapping feature should be used instead.

https://blog.golang.org/go1.13-errors

@@ -166,7 +167,7 @@ func NewAWSProvider(awsConfig AWSConfig) (*AWSProvider, error) {
SharedConfigState: session.SharedConfigEnable,
})
if err != nil {
return nil, err
return nil, errors.Wrap(err, "failed to instantiate AWS session")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ...

return nil, fmt.Errorf("failed to instantiate AWS session: %w", err)

See https://blog.golang.org/go1.13-errors for reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I hesitated to introduce a dep to a Go version; but just checked the CI and Dockerfile are using 1.14 so I assume we're good with go >= 1.13. Updated.

When faced with errors from cloud providers (like "Throttling: Rate exceeded"), it's not always easy to find what operation caused the failure, and what action was aborted, if any,

Let's make it easier to identify an error source (and affected object when possible) by providing more context (and by using easy to find error messages).
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 14, 2020
@seanmalloy
Copy link
Member

/lgtm
/assign @Raffo

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2020
@seanmalloy
Copy link
Member

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 16, 2020
Copy link
Contributor

@Raffo Raffo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bpineau, Raffo

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2020
@k8s-ci-robot k8s-ci-robot merged commit 110a521 into kubernetes-sigs:master Aug 17, 2020
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants