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

fix: resolve region only when profile credentials require it #582

Merged
merged 4 commits into from
Apr 14, 2022

Conversation

ianbotsf
Copy link
Contributor

Issue #

#581

Description of changes

This change removes the eager resolution of region in the profile credentials provider, which is unnecessary and can cause exceptions even when the region isn't needed (e.g., for static profile credentials).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf requested a review from a team as a code owner April 13, 2022 22:47
@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution

Copy link
Collaborator

@aajtodd aajtodd left a comment

Choose a reason for hiding this comment

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

Fix and ship!

@@ -115,40 +116,49 @@ public class ProfileCredentialsProvider(
return creds
}

private suspend fun resolveRegionOrThrow(platformProvider: PlatformProvider): String =
runCatching { resolveRegion(platformProvider) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix

resolveRegion already throws an exception that includes the entire chain that was tried. I think we should keep that behavior rather than throwing a new exception that lacks these details.

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution

@sonarcloud
Copy link

sonarcloud bot commented Apr 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

A new generated diff is ready to view: __generated-main...__generated-fix-unnecessary-region-resolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants