This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2151b7822d78590e24b9699a54b3e061c4e995f5 Author: Andrea Cosentino <[email protected]> AuthorDate: Thu Jun 15 10:59:47 2023 +0200 CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS EKS Signed-off-by: Andrea Cosentino <[email protected]> --- .../main/java/org/apache/camel/component/aws2/eks/EKS2Component.java | 3 ++- .../java/org/apache/camel/component/aws2/eks/EKS2Configuration.java | 1 - .../aws2/eks/client/impl/EKS2ClientIAMProfileOptimizedImpl.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Component.java b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Component.java index 28ddbc4564e..d67bd10d79f 100644 --- a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Component.java +++ b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Component.java @@ -45,7 +45,8 @@ public class EKS2Component extends DefaultComponent { EKS2Configuration configuration = this.configuration != null ? this.configuration.copy() : new EKS2Configuration(); EKS2Endpoint endpoint = new EKS2Endpoint(uri, this, configuration); setProperties(endpoint, parameters); - if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider()) && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider()) && configuration.getEksClient() == null + if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider()) + && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider()) && configuration.getEksClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { throw new IllegalArgumentException( "useDefaultCredentialsProvider is set to false, useProfileCredentialsProvider is set to false, Amazon eks client or accessKey and secretKey must be specified"); diff --git a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java index 44e5aaf2003..a5b438c666c 100644 --- a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java +++ b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java @@ -209,7 +209,6 @@ public class EKS2Configuration implements Cloneable { return useDefaultCredentialsProvider; } - public boolean isUseProfileCredentialsProvider() { return useProfileCredentialsProvider; } diff --git a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/client/impl/EKS2ClientIAMProfileOptimizedImpl.java b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/client/impl/EKS2ClientIAMProfileOptimizedImpl.java index be11747d956..372df70e269 100644 --- a/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/client/impl/EKS2ClientIAMProfileOptimizedImpl.java +++ b/components/camel-aws/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/client/impl/EKS2ClientIAMProfileOptimizedImpl.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.aws2.eks.client.impl; +import java.net.URI; + import org.apache.camel.component.aws2.eks.EKS2Configuration; import org.apache.camel.component.aws2.eks.client.EKS2InternalClient; import org.apache.camel.util.ObjectHelper; @@ -31,8 +33,6 @@ import software.amazon.awssdk.services.eks.EksClient; import software.amazon.awssdk.services.eks.EksClientBuilder; import software.amazon.awssdk.utils.AttributeMap; -import java.net.URI; - /** * Manage an AWS EKS client for all users to use (enabling temporary creds). This implementation is for remote instances * to manage the credentials on their own (eliminating credential rotations)
