Skip to content

AWS Route 53 dns provider error handling is inconsistent #8166

@Peac36

Description

@Peac36

Describe the bug:
While working on #7234 I came across several issues with how the errors are processed in route53 dns provder

func removeReqID(err error) error {
var responseError *awshttp.ResponseError
if errors.As(err, &responseError) {
before := responseError.Error()
// remove the request id from the error message
responseError.RequestID = "<REDACTED>"
after := responseError.Error()
return errors.New(strings.Replace(err.Error(), before, after, 1))
}
return err

The function removeReqID completely overwrites the error chain which makes using of errors.As and errors.Is impossible.

Seconds, the errors returned by aws-sdk are not correctly wrapped. The wrong verbs are used - %s, %v

return aws.Config{}, fmt.Errorf("unable to assume role: %s", removeReqID(err))

return aws.Config{}, fmt.Errorf("unable to assume role with web identity: %s", removeReqID(err))

return fmt.Errorf("failed to change Route 53 record set: %v", removeReqID(err))

return false, fmt.Errorf("failed to query Route 53 change status: %v", removeReqID(err))

Expected behaviour:

Steps to reproduce the bug:

Anything else we need to know?:

Environment details:

  • Kubernetes version:
  • Cloud-provider/provisioner:
  • cert-manager version:
  • Install method: e.g., helm/static manifests

/kind bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions