kitchen-dokken 2.1.10 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/kitchen/driver/dokken.rb +49 -21
- data/lib/kitchen/driver/dokken_version.rb +1 -1
- data/lib/kitchen/helpers.rb +1 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d82d62b99b5e5b0b3a7473ea621641c57d3e85d1
|
4
|
+
data.tar.gz: f1ee267ee61e13c37662731f2e3b6a6a7912986e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff69a7549fe0659fd10710c84e2e1f74a32ea0f7f940b7292a9add78a449fc8157af8e3686508fb2a591cd78e989383dcdab115cda163d3498dd1f74646a1fd0
|
7
|
+
data.tar.gz: 4e0939f5ef9e8b8a1dd4a5f8f9854271a8ec81bd441f012fbe63771f7236f9f86e643631b0a1d43b97948e7ec2ac204755738ead59224ac8e431bfe25109485d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Dokken Changelog
|
2
2
|
|
3
|
+
# 2.2.0
|
4
|
+
- Initial support for clusters / inter-suite name resolution
|
5
|
+
- Dokken now creates a user-defined network named "dokken" and
|
6
|
+
connects containers to it. This allows us to take advantage of the
|
7
|
+
built in DNS server that in Docker 1.10 and later.
|
8
|
+
|
9
|
+
driver:
|
10
|
+
hostname: www.computers.biz
|
11
|
+
|
3
12
|
# 2.1.10
|
4
13
|
- Adding boot2docker detection
|
5
14
|
|
@@ -44,10 +44,10 @@ module Kitchen
|
|
44
44
|
default_config :docker_info, docker_info
|
45
45
|
default_config :docker_host_url, default_docker_host
|
46
46
|
default_config :forward, nil
|
47
|
-
default_config :hostname,
|
47
|
+
default_config :hostname, 'dokken'
|
48
48
|
default_config :image_prefix, nil
|
49
49
|
default_config :links, nil
|
50
|
-
default_config :network_mode, '
|
50
|
+
default_config :network_mode, 'dokken'
|
51
51
|
default_config :pid_one_command, 'sh -c "trap exit 0 SIGTERM; while :; do sleep 1; done"'
|
52
52
|
default_config :privileged, false
|
53
53
|
default_config :read_timeout, 3600
|
@@ -64,6 +64,9 @@ module Kitchen
|
|
64
64
|
pull_chef_image
|
65
65
|
create_chef_container state
|
66
66
|
|
67
|
+
# network
|
68
|
+
make_dokken_network
|
69
|
+
|
67
70
|
# data
|
68
71
|
dokken_create_sandbox
|
69
72
|
|
@@ -237,43 +240,67 @@ module Kitchen
|
|
237
240
|
def start_runner_container(state)
|
238
241
|
debug "driver - starting #{runner_container_name}"
|
239
242
|
|
240
|
-
|
243
|
+
config = {
|
241
244
|
'name' => runner_container_name,
|
242
|
-
'Cmd' => Shellwords.shellwords(
|
245
|
+
'Cmd' => Shellwords.shellwords(self[:pid_one_command]),
|
243
246
|
'Image' => "#{repo(work_image)}:#{tag(work_image)}",
|
244
|
-
'Hostname' =>
|
245
|
-
'ExposedPorts' => exposed_ports({},
|
247
|
+
'Hostname' => self[:hostname],
|
248
|
+
'ExposedPorts' => exposed_ports({}, self[:forward]),
|
246
249
|
'Volumes' => dokken_volumes,
|
247
250
|
'HostConfig' => {
|
248
|
-
'Privileged' =>
|
251
|
+
'Privileged' => self[:privileged],
|
249
252
|
'VolumesFrom' => dokken_volumes_from,
|
250
253
|
'Binds' => dokken_binds,
|
251
|
-
'Dns' =>
|
252
|
-
'DnsSearch' =>
|
253
|
-
'Links' => Array(
|
254
|
-
'CapAdd' => Array(
|
255
|
-
'CapDrop' => Array(
|
256
|
-
'SecurityOpt' => Array(
|
257
|
-
'NetworkMode' =>
|
258
|
-
'PortBindings' => port_forwards({},
|
259
|
-
}
|
260
|
-
|
254
|
+
'Dns' => self[:dns],
|
255
|
+
'DnsSearch' => self[:dns_search],
|
256
|
+
'Links' => Array(self[:links]),
|
257
|
+
'CapAdd' => Array(self[:cap_add]),
|
258
|
+
'CapDrop' => Array(self[:cap_drop]),
|
259
|
+
'SecurityOpt' => Array(self[:security_opt]),
|
260
|
+
'NetworkMode' => self[:network_mode],
|
261
|
+
'PortBindings' => port_forwards({}, self[:forward]),
|
262
|
+
},
|
263
|
+
'NetworkingConfig' => {
|
264
|
+
'EndpointsConfig' => {
|
265
|
+
self[:network_mode] => {
|
266
|
+
'Aliases' => Array(self[:hostname]),
|
267
|
+
},
|
268
|
+
},
|
269
|
+
},
|
270
|
+
}
|
271
|
+
runner_container = run_container(config)
|
261
272
|
state[:runner_container] = runner_container.json
|
262
273
|
end
|
263
274
|
|
264
275
|
def start_data_container(state)
|
265
276
|
debug "driver - creating #{data_container_name}"
|
266
|
-
|
277
|
+
config = {
|
267
278
|
'name' => data_container_name,
|
268
279
|
'Image' => "#{repo(data_image)}:#{tag(data_image)}",
|
269
280
|
'HostConfig' => {
|
270
281
|
'PortBindings' => port_forwards({}, '22'),
|
271
282
|
'PublishAllPorts' => true,
|
272
|
-
|
273
|
-
|
283
|
+
'NetworkMode' => self[:network_mode],
|
284
|
+
},
|
285
|
+
'NetworkingConfig' => {
|
286
|
+
'EndpointsConfig' => {
|
287
|
+
self[:network_mode] => {
|
288
|
+
'Aliases' => self[:hostname],
|
289
|
+
},
|
290
|
+
},
|
291
|
+
},
|
292
|
+
}
|
293
|
+
data_container = run_container(config)
|
274
294
|
state[:data_container] = data_container.json
|
275
295
|
end
|
276
296
|
|
297
|
+
def make_dokken_network
|
298
|
+
debug 'driver - creating dokken network'
|
299
|
+
Docker::Network.create('dokken', {})
|
300
|
+
rescue
|
301
|
+
debug 'driver - dokken network already exists'
|
302
|
+
end
|
303
|
+
|
277
304
|
def make_data_image
|
278
305
|
debug 'driver - calling create_data_image'
|
279
306
|
create_data_image
|
@@ -287,7 +314,8 @@ module Kitchen
|
|
287
314
|
chef_container = create_container(
|
288
315
|
'name' => chef_container_name,
|
289
316
|
'Cmd' => 'true',
|
290
|
-
'Image' => "#{repo(chef_image)}:#{tag(chef_image)}"
|
317
|
+
'Image' => "#{repo(chef_image)}:#{tag(chef_image)}",
|
318
|
+
'NetworkMode' => config[:network_mode]
|
291
319
|
)
|
292
320
|
state[:chef_container] = chef_container.json
|
293
321
|
rescue
|
data/lib/kitchen/helpers.rb
CHANGED
@@ -137,11 +137,7 @@ EOF
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def instance_name
|
140
|
-
prefix =
|
141
|
-
(Digest::SHA2.hexdigest FileUtils.pwd)[0, 10]
|
142
|
-
else
|
143
|
-
config[:image_prefix]
|
144
|
-
end
|
140
|
+
prefix = (Digest::SHA2.hexdigest FileUtils.pwd)[0, 10]
|
145
141
|
"#{prefix}-#{instance.name}"
|
146
142
|
end
|
147
143
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-dokken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean OMeara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|