Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EKS credentials refresh bug #3114

Merged
merged 5 commits into from
Feb 13, 2024
Merged

Conversation

SamRemis
Copy link
Contributor

@SamRemis SamRemis commented Feb 6, 2024

This PR fixes a bug with EKS credentials not properly fetching the token from the token file if the file contents have been updated

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (03891ec) 93.14% compared to head (44e1cb6) 93.14%.
Report is 36 commits behind head on develop.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3114   +/-   ##
========================================
  Coverage    93.14%   93.14%           
========================================
  Files           66       66           
  Lines        14237    14237           
========================================
  Hits         13261    13261           
  Misses         976      976           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, looks good overall! A couple minor comments, after that I think we're good to ship it.

@@ -3165,6 +3166,45 @@ def test_can_pass_auth_token_from_file(self):
self.assertEqual(creds.token, 'token')
self.assertEqual(creds.method, 'container-role')

def test_reloads_auth_token_from_file(self):
token_file_path = os.path.join(self.tempdir, 'token.jwt')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, we're going to have collisions/race conditions if the tests happen to get run more than once on the same system. It may be a good idea to use temporary_file to ensure we're both isolated and cleaning up immediately.

"AccessKeyId": "first_key",
"SecretAccessKey": "first_secret",
"Token": "first_token",
"Expiration": (timeobj + timedelta(seconds=2)).isoformat(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; this could probably we 1s with a 1.5-2s sleep but that may end up creating more noise in the tests with false failures. Something to keep an eye on after release.

@SamRemis SamRemis merged commit 42903c4 into boto:develop Feb 13, 2024
34 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Feb 13, 2024
* release-1.34.41:
  Bumping version to 1.34.41
  Update to latest partitions and endpoints
  Update to latest models
  Fix EKS credentials refresh bug (#3114)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants