Skip to content

Migrate to AWS library to v2 - #6671

Merged
jetstack-bot merged 5 commits into
cert-manager:masterfrom
inteon:aws_v2
Feb 8, 2024
Merged

jetstack-bot merged 5 commits into
cert-manager:masterfrom
inteon:aws_v2

Conversation

@inteon

@inteon inteon commented Jan 27, 2024 •

Copy link
Copy Markdown
Member

Migrate from github.com/aws/aws-sdk-go to github.com/aws/aws-sdk-go-v2.
Fixes CVE alerts in the .trivyignore file.

Kind

/kind cleanup

Release Note

NONE

@jetstack-bot jetstack-bot 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. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/acme Indicates a PR directly modifies the ACME Issuer code area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/testing Issues relating to testing labels Jan 27, 2024
@inteon
inteon force-pushed the aws_v2 branch 2 times, most recently from 8174125 to 407a116 Compare January 28, 2024 08:56
@inteon
inteon requested a review from wallrj January 28, 2024 10:07
@inteon
inteon force-pushed the aws_v2 branch 2 times, most recently from 3d387e7 to 27dc626 Compare January 29, 2024 14:07

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Tim,

I asked a couple of questions below.

Comment thread pkg/issuer/acme/dns/route53/route53.go Resolved
Comment thread pkg/issuer/acme/dns/route53/route53.go Resolved
@inteon
inteon requested a review from wallrj January 30, 2024 10:06
@inteon

inteon commented Jan 30, 2024

Copy link
Copy Markdown
Member Author

/retest

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// we have a non-nil error coming from an aws-sdk-go func. The passed error
// is modified in place. This function does not work in case the full error
// message is pre-generated at construction time (instead of when Error() is
// called), which is the case for eg. fmt.Errorf("error message: %w", err).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As far as I know it creates a new error with an Unwrap method that allows the underlying error to be accessed.
Perhaps I misunderstood how %w works.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the message string that is created when you call the function: https://cs.opensource.google/go/go/+/refs/tags/go1.22.0:src/fmt/errors.go;l=55
If you change the wrapped error afterwards, the message will still be the same.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I think I understand. I hadn't looked at the implementation of fmt.Errorf until now.
And I see that it sets the error message string when it is called, so any subsequent changes to the wrapped error are not reflected in the error string....like you said in that comment:

https://github.com/golang/go/blob/1400b268529f1bbacde83b3dc022fec0b196846b/src/fmt/errors.go#L26-L32

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

// we have a non-nil error coming from an aws-sdk-go func. The passed error
// is modified in place. This function does not work in case the full error
// message is pre-generated at construction time (instead of when Error() is
// called), which is the case for eg. fmt.Errorf("error message: %w", err).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I think I understand. I hadn't looked at the implementation of fmt.Errorf until now.
And I see that it sets the error message string when it is called, so any subsequent changes to the wrapped error are not reflected in the error string....like you said in that comment:

https://github.com/golang/go/blob/1400b268529f1bbacde83b3dc022fec0b196846b/src/fmt/errors.go#L26-L32

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2024
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

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. area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/acme Indicates a PR directly modifies the ACME Issuer code area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

3 participants