HADOOP-18481. AWS v2 SDK upgrade log to not about standard AWS Credential Providers. (#4973)

The AWS SDKV2 upgrade log no longer warns about instantiation
of the v1 SDK credential providers which are commonly used in
s3a configurations:

* com.amazonaws.auth.EnvironmentVariableCredentialsProvider
* com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper
* com.amazonaws.auth.InstanceProfileCredentialsProvider

When the hadoop-aws module moves to the v2 SDK, references to these
credential providers will be rewritten to their v2 equivalents.

Follow-on to HADOOP-18382. "Upgrade AWS SDK to V2 - Prerequisites"

Contributed by Ahmar Suhail
This commit is contained in:
ahmarsuhail 2022-10-14 10:48:09 +01:00 committed by GitHub
parent 5b52123c9d
commit 77e551a478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -640,7 +640,10 @@ public final class S3AUtils {
AWSCredentialProviderList providers = new AWSCredentialProviderList(); AWSCredentialProviderList providers = new AWSCredentialProviderList();
for (Class<?> aClass : awsClasses) { for (Class<?> aClass : awsClasses) {
if (aClass.getName().contains(AWS_AUTH_CLASS_PREFIX)) { // List of V1 credential providers that will be migrated with V2 upgrade
if (!Arrays.asList("EnvironmentVariableCredentialsProvider",
"EC2ContainerCredentialsProviderWrapper", "InstanceProfileCredentialsProvider")
.contains(aClass.getSimpleName()) && aClass.getName().contains(AWS_AUTH_CLASS_PREFIX)) {
V2Migration.v1ProviderReferenced(aClass.getName()); V2Migration.v1ProviderReferenced(aClass.getName());
} }