Skip to content

Commit

Permalink
addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alauddinulaganathan authored Apr 2, 2024
1 parent 00fc889 commit 46eb7b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/kubeclient/aws_eks_credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AmazonEksDependencyError < LoadError # rubocop:disable Lint/InheritExcepti
end

class << self
def token(credentials, eks_cluster, region: 'us-east-1', is_credentials_provider: false)
def token(credentials, eks_cluster, region: 'us-east-1')
begin
require 'aws-sigv4'
require 'base64'
Expand All @@ -20,7 +20,7 @@ def token(credentials, eks_cluster, region: 'us-east-1', is_credentials_provider
end
# https://github.com/aws/aws-sdk-ruby/pull/1848
# Get a signer
if is_credentials_provider
if credentials.respond_to?(:credentials)
signer = Aws::Sigv4::Signer.new(
service: 'sts',
region: region,
Expand All @@ -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: is_credentials_provider ? credentials.credentials : credentials,
credentials: credentials.respond_to?(:credentials) ? credentials.credentials : credentials,
expires_in: 60,
headers: {
'X-K8s-Aws-Id' => eks_cluster
Expand Down

0 comments on commit 46eb7b6

Please sign in to comment.