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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- encoding: utf-8 -*-

require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:test)
Expand Down
1 change: 0 additions & 1 deletion kitchen-ec2.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "kitchen/driver/ec2_version.rb"
Expand Down
1 change: 0 additions & 1 deletion lib/kitchen/driver/aws/client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion lib/kitchen/driver/aws/instance_generator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
7 changes: 7 additions & 0 deletions lib/kitchen/driver/aws/standard_platform/rhel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def self.from_image(driver, image)
new(driver, "rhel", (Regexp.last_match || [])[1], image.architecture)
end
end

def sort_by_version(images)
# 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.

end
end
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/kitchen/driver/ec2.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion lib/kitchen/driver/ec2_version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion spec/kitchen/driver/aws/client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion spec/kitchen/driver/aws/instance_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion spec/kitchen/driver/aws/standard_platform_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion spec/kitchen/driver/ec2_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Tyler Ball (<[email protected]>)
#
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<[email protected]>)
#
Expand Down