From 08760fc4c111b6956da3e5495250041acdc98a20 Mon Sep 17 00:00:00 2001 From: ahmarsuhail Date: Fri, 14 Oct 2022 10:48:09 +0100 Subject: [PATCH] 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 --- .../src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java index 72a1784dd0..bca2c61833 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java @@ -638,7 +638,10 @@ public static AWSCredentialProviderList buildAWSProviderList( AWSCredentialProviderList providers = new AWSCredentialProviderList(); 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()); }