Skip to content

Commit

Permalink
fix: Properly create default credentials provider
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Dec 18, 2024
1 parent d893841 commit bbe9216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/hudson/plugins/ec2/EC2Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -1118,16 +1118,16 @@ public static String getSlaveTypeTagValue(String slaveType, String templateDescr
public static AwsCredentialsProvider createCredentialsProvider(
final boolean useInstanceProfileForCredentials, final String credentialsId) {
if (useInstanceProfileForCredentials) {
return InstanceProfileCredentialsProvider.builder().build();
return InstanceProfileCredentialsProvider.create();
} else if (StringUtils.isBlank(credentialsId)) {
return DefaultCredentialsProvider.builder().build();
return DefaultCredentialsProvider.create();
} else {
AmazonWebServicesCredentials credentials = getCredentials(credentialsId);
if (credentials != null) {
return StaticCredentialsProvider.create(credentials.resolveCredentials());

Check warning on line 1127 in src/main/java/hudson/plugins/ec2/EC2Cloud.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1127 is not covered by tests
}
}
return DefaultCredentialsProvider.builder().build();
return DefaultCredentialsProvider.create();
}

public static AwsCredentialsProvider createCredentialsProvider(
Expand Down

0 comments on commit bbe9216

Please sign in to comment.