diff --git a/lib/kubeclient/aws_eks_credentials.rb b/lib/kubeclient/aws_eks_credentials.rb index 68169f7b..8194d012 100644 --- a/lib/kubeclient/aws_eks_credentials.rb +++ b/lib/kubeclient/aws_eks_credentials.rb @@ -39,7 +39,7 @@ def token(credentials, eks_cluster, region: 'us-east-1', is_credentials_provider http_method: 'GET', url: "https://sts.#{region}.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15", body: '', - credentials: credentials, + credentials: is_credentials_provider ? credentials.credentials : credentials, expires_in: 60, headers: { 'X-K8s-Aws-Id' => eks_cluster