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

RHEL-9435: Get AWS metadata via IMDSv2 #3351

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Conversation

m-horky
Copy link
Contributor

@m-horky m-horky commented Nov 1, 2023

  • Card ID: RHEL-9435

Even though both versions are officially supported, the AWS teams are tracking connections making v1 requests as WARNINGs 0.

This patch switches the order to try to use IMDSv2 first.

@m-horky m-horky requested a review from jirihnidek November 1, 2023 12:13
@cnsnyder cnsnyder requested a review from a team November 1, 2023 12:14
Copy link
Contributor

@jirihnidek jirihnidek left a comment

Choose a reason for hiding this comment

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

Some unit tests related to public clouds are failing. It seems related. Please fix these tests.

@m-horky
Copy link
Contributor Author

m-horky commented Nov 1, 2023

Yeah, I know about those. Working on it, I need to introduce some mocks. I know where the issues are.

@m-horky m-horky marked this pull request as draft November 1, 2023 15:13
@m-horky m-horky force-pushed the mhorky/RHEL-9435_aws-imdsv2 branch from 953f2df to 479fb5f Compare November 1, 2023 15:57
Copy link

github-actions bot commented Nov 1, 2023

Coverage

Coverage (computed on Fedora latest) •
FileStmtsMissCoverMissing
cloud_what/providers
   aws.py1835072%88, 103, 111, 148–149, 151–154, 156, 165, 168–169, 199, 203–204, 213–214, 224, 253, 265, 311, 313, 324, 347, 385–386, 388–389, 391–395, 397–402, 404–408, 410–413, 419
rhsm
   profile.py2257068%27–28, 32–33, 43, 63, 103–107, 109–113, 115–117, 119–126, 145–147, 151–153, 191, 204, 218–219, 229–230, 236, 244, 256, 266–267, 269–270, 279, 332, 347, 381–385, 395–397, 401–402, 412, 423–426, 433, 438, 453–456
TOTAL18159456774% 

Tests Skipped Failures Errors Time
2640 9 💤 0 ❌ 0 🔥 1m 10s ⏱️

* Card ID: RHEL-9435

Even though both versions are officially supported, the AWS teams are
tracking connections making v1 requests as WARNINGs [0].

This patch switches the order to try to use IMDSv2 first.

[0]: https://github.com/aws/aws-imds-packet-analyzer
The function responsible for returning 'server' responses was altered to
be less nested, which should improve its readability.
When type hints for 'dnf' are not available, loading this module would
result in a test failure.
@m-horky m-horky force-pushed the mhorky/RHEL-9435_aws-imdsv2 branch from 479fb5f to c8b7cb7 Compare November 1, 2023 16:12
@m-horky m-horky marked this pull request as ready for review November 1, 2023 16:19
@cnsnyder cnsnyder requested a review from a team November 1, 2023 16:20
Copy link
Contributor

@jirihnidek jirihnidek left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks 👍

@jirihnidek jirihnidek merged commit 425aa7c into main Nov 6, 2023
11 checks passed
@jirihnidek jirihnidek deleted the mhorky/RHEL-9435_aws-imdsv2 branch November 6, 2023 14:13
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.

2 participants