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

Prefer non-Beta RHEL AMIs in search; remove encoding comments #506

Merged
merged 2 commits into from
Aug 14, 2020

Conversation

clintoncwolfe
Copy link
Contributor

Description

When searching for RHEL AMIs, this change alters the search sort so that Beta AMIs are sorted after non-Beta (GA) AMIs. This has the effect of making it so that searches for rhel-7 will return RHEL 7.8 rather than RHEL 7.9 Beta, which is the expected behavior.

To obtain RHEL 7.9, search explicitly for rhel-7.9 - that will cause all search results to be Beta, in which case this search sort change will have no effect.

Also includes a drive-by Chefstyle update for removing the encoding comments, on a separate commit.

Issues Resolved

Fixes #505

Closes chef/chef-workstation#1410

Check List

  • All tests pass. See TESTING.md for details.
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

# First do a normal version sort
super(images)
# Now sort again, shunning Beta releases.
prefer(images) { |image| !image.name.match(/_Beta-/i) }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"RHEL-7.9_HVM_BETA-20200422-x86_64-0-Hourly2-GP2"
"RHEL-7.8_HVM_GA-20200225-x86_64-1-Hourly2-GP2"
"RHEL-7.4_HVM_Beta-20170518-x86_64-1-Hourly2-GP2"
Are some examples of the strings to match.

@tas50 tas50 merged commit a36eabc into test-kitchen:master Aug 14, 2020
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.

[kitchen-ec2] RHEL image search results in beta AMI platform: rhel-7 search gets a beta ami
2 participants