From e477d24219a69ef5aa39911e2715aee9d957c8d5 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Sat, 18 Jan 2025 17:44:36 +0100 Subject: [PATCH] Fix #2048 --- pkg/credentials/iam_aws.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/credentials/iam_aws.go b/pkg/credentials/iam_aws.go index 0ba06e710..5c046577e 100644 --- a/pkg/credentials/iam_aws.go +++ b/pkg/credentials/iam_aws.go @@ -153,9 +153,6 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { } endpoint := m.Endpoint - if endpoint == "" { - endpoint = cc.Endpoint - } switch { case identityFile != "": @@ -218,6 +215,9 @@ func (m *IAM) RetrieveWithCredContext(cc *CredContext) (Value, error) { roleCreds, err = getEcsTaskCredentials(client, endpoint, token) default: + if endpoint == "" { + endpoint = cc.Endpoint + } roleCreds, err = getCredentials(client, endpoint) }