-
Notifications
You must be signed in to change notification settings - Fork 877
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
Refactor tryDetectRegion Method . Remove aws-json-protocol dependency #3324
base: feature/master/imds
Are you sure you want to change the base?
Refactor tryDetectRegion Method . Remove aws-json-protocol dependency #3324
Conversation
core/imds/src/main/java/software/amazon/awssdk/imds/internal/DefaultEc2Metadata.java
Show resolved
Hide resolved
SonarCloud Quality Gate failed. |
@@ -72,7 +72,7 @@ private DefaultEc2Metadata(DefaultEc2Metadata.Ec2MetadataBuilder builder) { | |||
this.tokenTtl = builder.tokenTtl != null ? builder.tokenTtl : Duration.ofSeconds(21600); | |||
this.endpointMode = ENDPOINT_PROVIDER.resolveEndpointMode(builder.endpointMode); | |||
this.httpDebugOutput = builder.httpDebugOutput; | |||
this.httpClient = builder.httpClient != null ? builder.httpClient : UrlConnectionHttpClient.create(); | |||
this.httpClient = builder.httpClient != null ? builder.httpClient : ApacheHttpClient.create(); |
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.
This would cause build to fail for applications that only have/use UrlConnectionHttpClient as HTTP dependency.
We should load the http client using the default chain instead of defaulting to an implementation explicitly
Line 30 in e320d12
private static final SdkHttpServiceProvider<SdkHttpService> DEFAULT_CHAIN = new CachingSdkHttpServiceProvider<>( |
Refactor tryDetectRegion Method . Remove aws-json-protocol dependency
Motivation and Context
Refactor tryDetectRegion Method . Remove aws-json-protocol dependency
Modifications
Refactor tryDetectRegion Method . Remove aws-json-protocol dependency
Testing
Ran Existing InstanceProfileRegionProvider Test and is compliant.
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License