Skip to content

Commit

Permalink
Fix EKS credentials refresh bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SamRemis committed Feb 5, 2024
1 parent 03891ec commit fa3749a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-ContainerProvider-22191.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "ContainerProvider",
"description": "Properly refreshes token from file from EKS in ContainerProvider"
}
6 changes: 3 additions & 3 deletions botocore/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -1930,8 +1930,7 @@ def _retrieve_or_fail(self):
full_uri = self._fetcher.full_url(self._environ[self.ENV_VAR])
else:
full_uri = self._environ[self.ENV_VAR_FULL]
headers = self._build_headers()
fetcher = self._create_fetcher(full_uri, headers)
fetcher = self._create_fetcher(full_uri)
creds = fetcher()
return RefreshableCredentials(
access_key=creds['access_key'],
Expand All @@ -1958,9 +1957,10 @@ def _validate_auth_token(self, auth_token):
if "\r" in auth_token or "\n" in auth_token:
raise ValueError("Auth token value is not a legal header value")

def _create_fetcher(self, full_uri, headers):
def _create_fetcher(self, full_uri, *args, **kwargs):
def fetch_creds():
try:
headers = self._build_headers()
response = self._fetcher.retrieve_full_uri(
full_uri, headers=headers
)
Expand Down

0 comments on commit fa3749a

Please sign in to comment.