[
https://issues.apache.org/jira/browse/HADOOP-18945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17776750#comment-17776750
]
ASF GitHub Bot commented on HADOOP-18945:
-----------------------------------------
steveloughran commented on code in PR #6202:
URL: https://github.com/apache/hadoop/pull/6202#discussion_r1364111815
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/IAMInstanceCredentialsProvider.java:
##########
@@ -48,10 +53,18 @@
public class IAMInstanceCredentialsProvider
implements AwsCredentialsProvider, Closeable {
- private final AwsCredentialsProvider containerCredentialsProvider =
- ContainerCredentialsProvider.builder().build();
+ private static final Logger LOG =
+ LoggerFactory.getLogger(IAMInstanceCredentialsProvider.class);
+
+ private HttpCredentialsProvider iamCredentialsProvider = null;
Review Comment:
add some javadocs
##########
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/TestIAMInstanceCredentialsProvider.java:
##########
@@ -0,0 +1,102 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.fs.s3a.auth;
+
+import java.io.IOException;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+
+import org.apache.hadoop.test.AbstractHadoopTestBase;
+
+
+/**
+ * Unit tests for IAMInstanceCredentials provider.
+ * This is a bit tricky as don't want to
+ */
+public class TestIAMInstanceCredentialsProvider extends AbstractHadoopTestBase
{
Review Comment:
add a test which calls multiple times
> S3A: IAMInstanceCredentialsProvider failing: Failed to load credentials from
> IMDS
> ---------------------------------------------------------------------------------
>
> Key: HADOOP-18945
> URL: https://issues.apache.org/jira/browse/HADOOP-18945
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 7.2.18.0
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Blocker
> Labels: pull-request-available
>
> Failures in impala test VMs using iAM for auth
> {code}
> Failed to open file as a parquet file: java.net.SocketTimeoutException:
> re-open
> s3a://impala-test-uswest2-1/test-warehouse/test_pre_gregorian_date_parquet_2e80ae30.db/hive2_pre_gregorian.parquet
> at 84 on
> s3a://impala-test-uswest2-1/test-warehouse/test_pre_gregorian_date_parquet_2e80ae30.db/hive2_pre_gregorian.parquet:
> org.apache.hadoop.fs.s3a.auth.NoAwsCredentialsException: +: Failed to load
> credentials from IMDS
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]