kitchen-ec2 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/aws/standard_platform/centos.rb +25 -2
- data/lib/kitchen/driver/ec2.rb +25 -1
- data/lib/kitchen/driver/ec2_version.rb +1 -1
- metadata +5 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: effb6d0cc14377657291cd970e2a6d50680d91df937b6799f0a942a2fba59994
|
4
|
+
data.tar.gz: a2a0b678c22cf3da32be2ee90cb542cc2c2dff015fb3563ea7783b85ddd57649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2761f62c4647000ee4b12ac11a0080f49bb5492c296e08a22c598d1bfb0a0ea993b7d0409c04003d7819d7f287dd9fd65b611f2135c8edf69a5e36421549ea2c
|
7
|
+
data.tar.gz: 96b9d6c0062d85baafa9febca4fe0567f2659dc505c3e89da85caa3b6f82590f5a981d8df2907ee1f15709374e1e31f833f4cbb940a87b83283086e11084adab
|
@@ -23,6 +23,14 @@ module Kitchen
|
|
23
23
|
class Centos < StandardPlatform
|
24
24
|
StandardPlatform.platforms["centos"] = self
|
25
25
|
|
26
|
+
CENTOS_OWNER_ID = "125523088429".freeze
|
27
|
+
PRODUCT_CODES = {
|
28
|
+
"6" => "6x5jmcajty9edm3f211pqjfn2",
|
29
|
+
"7" => "aw0evgkw8e5c1q413zgy5pjce",
|
30
|
+
# It appears that v8 is not published to the
|
31
|
+
# AWS marketplace and hence does not have a product code
|
32
|
+
}.freeze
|
33
|
+
|
26
34
|
# default username for this platform's ami
|
27
35
|
# @return [String]
|
28
36
|
def username
|
@@ -34,10 +42,25 @@ module Kitchen
|
|
34
42
|
end
|
35
43
|
|
36
44
|
def image_search
|
45
|
+
# Version 8+ are published directly, not to the AWS marketplace. Use OWNER ID.
|
37
46
|
search = {
|
38
|
-
"owner-
|
39
|
-
"name" => ["CentOS
|
47
|
+
"owner-id" => CENTOS_OWNER_ID,
|
48
|
+
"name" => ["CentOS #{version}*", "CentOS-#{version}*-GA-*"],
|
40
49
|
}
|
50
|
+
|
51
|
+
if version && version.split(".").first.to_i < 8
|
52
|
+
# Versions <8 are published to the AWS marketplace and use a different naming convention
|
53
|
+
search = {
|
54
|
+
"owner-alias" => "aws-marketplace",
|
55
|
+
"name" => ["CentOS Linux #{version}*", "CentOS-#{version}*-GA-*"],
|
56
|
+
}
|
57
|
+
# For versions published to aws-marketplace, additionally filter on product code to
|
58
|
+
# avoid non-official AMIs. Can't use CentOS owner ID here, as the owner ID is that of aws marketplace.
|
59
|
+
# https://github.com/test-kitchen/kitchen-ec2/issues/456
|
60
|
+
PRODUCT_CODES.keys.each do |major_version|
|
61
|
+
search["product-code"] = PRODUCT_CODES[major_version] if version.start_with?(major_version)
|
62
|
+
end
|
63
|
+
end
|
41
64
|
search["architecture"] = architecture if architecture
|
42
65
|
search
|
43
66
|
end
|
data/lib/kitchen/driver/ec2.rb
CHANGED
@@ -424,7 +424,31 @@ module Kitchen
|
|
424
424
|
def submit_spots
|
425
425
|
configs = [config]
|
426
426
|
expanded = []
|
427
|
-
keys = %i{instance_type
|
427
|
+
keys = %i{instance_type}
|
428
|
+
|
429
|
+
unless config[:subnet_filter]
|
430
|
+
# => Use explicitly specified subnets
|
431
|
+
keys << :subnet_id
|
432
|
+
else
|
433
|
+
# => Enable cascading through matching subnets
|
434
|
+
client = ::Aws::EC2::Client.new(region: config[:region])
|
435
|
+
subnets = client.describe_subnets(
|
436
|
+
filters: [
|
437
|
+
{
|
438
|
+
name: "tag:#{config[:subnet_filter][:tag]}",
|
439
|
+
values: [config[:subnet_filter][:value]],
|
440
|
+
},
|
441
|
+
]
|
442
|
+
).subnets
|
443
|
+
raise "A subnet matching '#{config[:subnet_filter][:tag]}:#{config[:subnet_filter][:value]}' does not exist!" unless subnets.any?
|
444
|
+
|
445
|
+
configs = subnets.map do |subnet|
|
446
|
+
new_config = config.clone
|
447
|
+
new_config[:subnet_id] = subnet.subnet_id
|
448
|
+
new_config[:subnet_filter] = nil
|
449
|
+
new_config
|
450
|
+
end
|
451
|
+
end
|
428
452
|
|
429
453
|
keys.each do |key|
|
430
454
|
configs.each do |conf|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fletcher Nichol
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -30,34 +30,6 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3'
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: excon
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0'
|
40
|
-
type: :runtime
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: multi_json
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
61
33
|
- !ruby/object:Gem::Dependency
|
62
34
|
name: aws-sdk-ec2
|
63
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,20 +106,6 @@ dependencies:
|
|
134
106
|
- - "~>"
|
135
107
|
- !ruby/object:Gem::Version
|
136
108
|
version: '0.6'
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: simplecov
|
139
|
-
requirement: !ruby/object:Gem::Requirement
|
140
|
-
requirements:
|
141
|
-
- - "~>"
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: '0.7'
|
144
|
-
type: :development
|
145
|
-
prerelease: false
|
146
|
-
version_requirements: !ruby/object:Gem::Requirement
|
147
|
-
requirements:
|
148
|
-
- - "~>"
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
version: '0.7'
|
151
109
|
- !ruby/object:Gem::Dependency
|
152
110
|
name: yard
|
153
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -216,7 +174,7 @@ homepage: https://github.com/test-kitchen/kitchen-ec2
|
|
216
174
|
licenses:
|
217
175
|
- Apache-2.0
|
218
176
|
metadata: {}
|
219
|
-
post_install_message:
|
177
|
+
post_install_message:
|
220
178
|
rdoc_options: []
|
221
179
|
require_paths:
|
222
180
|
- lib
|
@@ -232,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
190
|
version: '0'
|
233
191
|
requirements: []
|
234
192
|
rubygems_version: 3.1.2
|
235
|
-
signing_key:
|
193
|
+
signing_key:
|
236
194
|
specification_version: 4
|
237
195
|
summary: A Test Kitchen Driver for Amazon EC2
|
238
196
|
test_files: []
|