kitchen-ec2 3.22.5 → 3.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b0df53042d4b64a308daa562bf17cb8abd153401ef6dfcbe52923c0ce5f39e4
4
- data.tar.gz: 42661134a81e0a10520b6fd1d0203dddd2e3243eb81a7ec311434fe6d13e79fc
3
+ metadata.gz: d76b2f770574b013ffc87ef6c3f38bf57c6b7d768027f9a7c6740c547ce21c78
4
+ data.tar.gz: 44c62f491df393d54a17890c71ae7dce5c13d58268968a67cbbd7b84e8187f7f
5
5
  SHA512:
6
- metadata.gz: 7ad00804a1486a61c09e19f27208d66d1e711d65e68bb706d046af0f2c5d63b925a576a250045630488ba3940ec550809a473975fcf773ad45139ea21d429a08
7
- data.tar.gz: c60ede94df2a091cee32097688b49acfdf7c5830a2e0029e6b980eab57fdcc53f5670d8366db916949b15c0ab7fab6fa642bb167b4da6265cb163b753c0ca59c
6
+ metadata.gz: 6f0ee93c28b277c5b12dbe96b4b67a07ac31c698cd48932eda5bddf913e26216783bc54bf8931a73d8db6be9fcb8bcdaaa69d678fe12ed677c57d1338741eb5b
7
+ data.tar.gz: 0cff3dbfad8475ee34b916eec54dd10848dd3bb2e449ae6f142ff5680c3cbc4e52efdc208bd7474c9bd75150ed86a1f134c5f9c21d4fe9d78eee94fd90889ee4
@@ -81,7 +81,7 @@ module Kitchen
81
81
 
82
82
  # Allocate a new dedicated host for the configured instance type.
83
83
  #
84
- # A `.metal` size occupies a whole host, so it is allocated for that
84
+ # A bare-metal size occupies a whole host, so it is allocated for that
85
85
  # exact type; every other size can share a host, so the whole instance
86
86
  # family is allocated and EC2 places instances within it.
87
87
  #
@@ -118,8 +118,8 @@ module Kitchen
118
118
  ],
119
119
  }
120
120
 
121
- # ".metal" is a 1:1 association, everything else has multi-instance capability
122
- if instance_size_from_type(config[:instance_type]) == "metal"
121
+ # Bare metal is a 1:1 association, everything else has multi-instance capability
122
+ if metal_instance_type?(config[:instance_type])
123
123
  request[:instance_type] = config[:instance_type]
124
124
  else
125
125
  request[:instance_family] = instance_family_from_type(config[:instance_type])
@@ -161,6 +161,20 @@ module Kitchen
161
161
  instance_type.split(".").last
162
162
  end
163
163
 
164
+ # Whether an instance type runs on bare metal.
165
+ #
166
+ # Older families expose a single bare-metal size named plainly
167
+ # ".metal". Newer ones expose several on the same family and name them
168
+ # ".metal-24xl", ".metal-48xl" and so on, so an equality check against
169
+ # "metal" would take them for virtualized sizes and allocate their host
170
+ # by family.
171
+ #
172
+ # @param instance_type [String] a type in "family.size" form, e.g. "m7i.metal-24xl"
173
+ # @return [Boolean] true when an instance of this type occupies a whole host
174
+ def metal_instance_type?(instance_type)
175
+ instance_size_from_type(instance_type).start_with?("metal")
176
+ end
177
+
164
178
  # Whether the user has opted in to allocating dedicated hosts.
165
179
  #
166
180
  # @return [Boolean]
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for EC2 Test Kitchen driver
22
- EC2_VERSION = "3.22.5".freeze
22
+ EC2_VERSION = "3.22.6".freeze
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.22.5
4
+ version: 3.22.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Test Kitchen Team