kitchen-ec2 3.22.4 → 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 +4 -4
- data/lib/kitchen/driver/aws/dedicated_hosts.rb +17 -3
- data/lib/kitchen/driver/ec2.rb +4 -4
- data/lib/kitchen/driver/ec2_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d76b2f770574b013ffc87ef6c3f38bf57c6b7d768027f9a7c6740c547ce21c78
|
|
4
|
+
data.tar.gz: 44c62f491df393d54a17890c71ae7dce5c13d58268968a67cbbd7b84e8187f7f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
-
#
|
|
122
|
-
if
|
|
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]
|
data/lib/kitchen/driver/ec2.rb
CHANGED
|
@@ -415,17 +415,17 @@ module Kitchen
|
|
|
415
415
|
|
|
416
416
|
# The instance type to use when the user did not choose one.
|
|
417
417
|
#
|
|
418
|
-
#
|
|
418
|
+
# t3 instances require a hardware-virtualized image, so a paravirtual
|
|
419
419
|
# image falls back to the older t1 family.
|
|
420
420
|
#
|
|
421
421
|
# @return [String] a free-tier instance type
|
|
422
422
|
def default_instance_type
|
|
423
423
|
@instance_type ||= if image && image.virtualization_type == "hvm"
|
|
424
|
-
info("instance_type not specified. Using free tier
|
|
425
|
-
"
|
|
424
|
+
info("instance_type not specified. Using free tier t3.micro instance ...")
|
|
425
|
+
"t3.micro"
|
|
426
426
|
else
|
|
427
427
|
info("instance_type not specified. Using free tier t1.micro instance since" \
|
|
428
|
-
" image is paravirtual (pick an hvm image to use the superior
|
|
428
|
+
" image is paravirtual (pick an hvm image to use the superior t3.micro!) ...")
|
|
429
429
|
"t1.micro"
|
|
430
430
|
end
|
|
431
431
|
end
|