Skip to content

Commit

Permalink
Remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Nov 14, 2023
1 parent 0caa293 commit e01d9a9
Showing 1 changed file with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,17 @@ public class HoodieConfigAWSAssumedRoleCredentialsProvider implements AwsCredent
private final StsAssumeRoleCredentialsProvider credentialsProvider;

public HoodieConfigAWSAssumedRoleCredentialsProvider(Properties props) {
if (!validConf(props)) {
LOG.debug("AWS role ARN not found in the Hudi configuration.");
throw new IllegalArgumentException("AWS role ARN not found in the Hudi configuration.");
} else {
String roleArn = props.getProperty(HoodieAWSConfig.AWS_ASSUME_ROLE_ARN.key());
AssumeRoleRequest req = AssumeRoleRequest.builder()
.roleArn(roleArn)
.roleSessionName("hoodie")
.build();
StsClient stsClient = StsClient.builder().build();
String roleArn = props.getProperty(HoodieAWSConfig.AWS_ASSUME_ROLE_ARN.key());
AssumeRoleRequest req = AssumeRoleRequest.builder()
.roleArn(roleArn)
.roleSessionName("hoodie")
.build();
StsClient stsClient = StsClient.builder().build();

this.credentialsProvider = StsAssumeRoleCredentialsProvider.builder()
.stsClient(stsClient)
.refreshRequest(req)
.build();
}
this.credentialsProvider = StsAssumeRoleCredentialsProvider.builder()
.stsClient(stsClient)
.refreshRequest(req)
.build();
}

public static boolean validConf(Properties props) {
Expand Down

0 comments on commit e01d9a9

Please sign in to comment.