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: Mismatch on Owner id for windows ami #93

Merged
merged 3 commits into from
Mar 22, 2023
Merged

fix: Mismatch on Owner id for windows ami #93

merged 3 commits into from
Mar 22, 2023

Conversation

quixoticmonk
Copy link
Contributor

@quixoticmonk quixoticmonk commented Mar 21, 2023

Summary

Updated the eks image check and custom ami verification paths to not be locked against the owner-ids which were from us-east-1. The owner-id specified for windows amis were not matching the actuals owner ids. This is an interim fix as described in #92 before rolling out additional changes.

Errors noticed:
With the filtered values( including the owner-id) in describe images call, the ami ids were being flagged as custom amis.

Pod Security Policy with eks.privileged role exists.
Fetching node group details...
i-011a9369a6162bd0f cannot be upgraded as it uses a custom AMI!

Tested against a cluster with Windows node and based out of us-east-2 to verify that both the windows nodes and the owner id mapping were not causing any regressions.

Resolves: #92

Changes

Removed the owner id references from all the filters as this is region dependent. The additional filters were modified for readability.

Note : With the filters removing the owner-ids which were previously there, the api call returns few more results than previously. This is to be updated in a later PR with the change in the model that is ongoing.

User experience

Fixes the issue mentioned in #92 . Existing amis in a region should be identified.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 11.96% and project coverage change: -0.34 ⚠️

Comparison is base (924cdbf) 27.88% compared to head (61fa223) 27.55%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
- Coverage   27.88%   27.55%   -0.34%     
==========================================
  Files          13       14       +1     
  Lines        1922     1938      +16     
==========================================
- Hits          536      534       -2     
- Misses       1386     1404      +18     
Impacted Files Coverage Δ
eksupgrade/__main__.py 0.00% <0.00%> (ø)
eksupgrade/src/preflight_module.py 4.39% <0.94%> (-0.01%) ⬇️
eksupgrade/models/eks.py 59.75% <2.77%> (-0.54%) ⬇️
eksupgrade/src/k8s_client.py 28.18% <7.14%> (ø)
eksupgrade/starter.py 19.54% <10.52%> (+6.20%) ⬆️
eksupgrade/src/boto_aws.py 10.84% <11.76%> (ø)
eksupgrade/src/eks_get_image_type.py 14.28% <12.50%> (-0.26%) ⬇️
eksupgrade/src/self_managed.py 16.00% <12.50%> (ø)
eksupgrade/cli.py 23.00% <21.42%> (-70.11%) ⬇️
eksupgrade/models/base.py 80.43% <33.33%> (-1.79%) ⬇️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@quixoticmonk quixoticmonk marked this pull request as ready for review March 22, 2023 01:10
@quixoticmonk quixoticmonk requested a review from a team March 22, 2023 01:18
@quixoticmonk quixoticmonk changed the title fix: Mismatch on Owner id for ami fix: Mismatch on Owner id for windows ami Mar 22, 2023
Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

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

Thank you for patching this!

One question, but looks good!

eksupgrade/src/eks_get_image_type.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@mbeacom mbeacom merged commit 5f164f7 into aws-samples:main Mar 22, 2023
@quixoticmonk quixoticmonk deleted the fix/windows-ami-owner branch March 22, 2023 01:47
@mbeacom mbeacom added the bug-fix Bug Fix label Mar 22, 2023
{"Name": "name", "Values": ["amazon-eks-node-*"]},
{"Name": "is-public", "Values": ["true"]},
]
filters.append({"Name": "name", "Values": ["amazon-eks-node-*"]})
Copy link
Member

Choose a reason for hiding this comment

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

We should change this to pull from the SSM parameters since this is the recommended approach. There may exist a newer AMI available based on these filters, but it may not be meant for consumption for various reasons (if the AMI is being recalled, etc.)

{"Name": "name", "Values": ["ubuntu-eks/k8s_*"]},
{"Name": "is-public", "Values": ["true"]},
]
filters.append({"Name": "name", "Values": ["ubuntu-eks/k8s_*"]})
Copy link
Member

Choose a reason for hiding this comment

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

We can remove Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Owner ID does not look correct for Windows AMI images
4 participants