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 7cc7d635c5..978ebe5bde 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 @@ -640,7 +640,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()); }