kitchen-dokken 2.8.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b746f7ad067bdc9c5ec6654a8445b95bd0ba32eb510066efb631b2c2983477fb
4
- data.tar.gz: e4de65e4624e7b30ca0a4d229d835cba390c17faab88df0707a8406ab0520598
3
+ metadata.gz: 9457c866ed76959da525c5c6ff2cf79ec23ce6f1bc0b3b4f19a1d65dbb8c53d1
4
+ data.tar.gz: 12416b24465f12771c00ff3d702f0c2283a763e113710da7f5fa43b8f4c21ae5
5
5
  SHA512:
6
- metadata.gz: ed977a55991a7fd959d2d484e1789afe4e8047bdb7356ea9eb789c43c2763cdfe25a483f05287e3b055b608d402d27e88bc25a1dff15a806ebe85f512960a209
7
- data.tar.gz: '079c039920015e6b022379113da30e134d3217399df8d1085bd2f4af5cc1eb430641d4d63f117e988773ae629eb57d292402e6db7397bf4070a0b2d661f92356'
6
+ metadata.gz: 6b1bd8719579b19eca0d091b713c00d94cdfd08e4f3d4a5c79caae06301bfd0bc0f2e84dac691f4a55824e7e0a87a6bf7cc5cce1c3b29c35b9b4414aa2cf687a
7
+ data.tar.gz: b943f80b7f0664155366080e2a9fe4d3b07e897b77c396d87d31d103c32935d16a7b44c75bf2525f729b028d2bb8bb7a77f8c9f2e98dd2a57ae7e67cb03fc326
@@ -61,6 +61,7 @@ module Kitchen
61
61
  default_config :userns_host, false
62
62
  default_config :pull_platform_image, true
63
63
  default_config :pull_chef_image, true
64
+ default_config :memory_limit, 0
64
65
 
65
66
  # (see Base#create)
66
67
  def create(state)
@@ -300,6 +301,7 @@ module Kitchen
300
301
  'NetworkMode' => self[:network_mode],
301
302
  'PortBindings' => port_bindings,
302
303
  'Tmpfs' => dokken_tmpfs,
304
+ 'Memory' => self[:memory_limit],
303
305
  },
304
306
  'NetworkingConfig' => {
305
307
  'EndpointsConfig' => {
@@ -436,9 +438,9 @@ module Kitchen
436
438
  rescue
437
439
  with_retries do
438
440
  begin
439
- args['env'] = [] if args['env'].nil?
440
- args['env'] << 'TEST_KITCHEN=1'
441
- args['env'] << "CI=#{ENV['CI']}" if ENV.include? 'CI'
441
+ args['Env'] = [] if args['Env'].nil?
442
+ args['Env'] << 'TEST_KITCHEN=1'
443
+ args['Env'] << "CI=#{ENV['CI']}" if ENV.include? 'CI'
442
444
  info "Creating container #{args['name']}"
443
445
  debug "driver - create_container args #{args}"
444
446
  with_retries do
@@ -18,6 +18,6 @@
18
18
  module Kitchen
19
19
  module Driver
20
20
  # Version string for Dokken Kitchen driver
21
- DOKKEN_VERSION = '2.8.0'.freeze
21
+ DOKKEN_VERSION = '2.10.0'.freeze
22
22
  end
23
23
  end
@@ -30,7 +30,7 @@ module Kitchen
30
30
  plugin_version Kitchen::VERSION
31
31
 
32
32
  default_config :root_path, '/opt/kitchen'
33
- default_config :chef_binary, '/opt/chef/embedded/bin/chef-client'
33
+ default_config :chef_binary, '/opt/chef/bin/chef-client'
34
34
  default_config :chef_options, ' -z'
35
35
  default_config :chef_log_level, 'warn'
36
36
  default_config :chef_output_format, 'doc'
@@ -50,10 +50,12 @@ module Kitchen
50
50
  driver = provisioner.instance.driver
51
51
  driver[:chef_version]
52
52
  end
53
+ default_config :clean_dokken_sandbox, true
53
54
 
54
55
  # (see Base#call)
55
56
  def call(state)
56
57
  create_sandbox
58
+ write_run_command(run_command)
57
59
  instance.transport.connection(state) do |conn|
58
60
  if remote_docker_host?
59
61
  info("Transferring files to #{instance.to_str}")
@@ -62,7 +64,7 @@ module Kitchen
62
64
 
63
65
  conn.execute(prepare_command)
64
66
  conn.execute_with_retry(
65
- run_command,
67
+ "sh #{config[:root_path]}/run_command",
66
68
  config[:retry_on_exit_code],
67
69
  config[:max_retries],
68
70
  config[:wait_for_retry]
@@ -71,6 +73,7 @@ module Kitchen
71
73
  rescue Kitchen::Transport::TransportFailed => ex
72
74
  raise ActionFailed, ex.message
73
75
  ensure
76
+ return unless config[:clean_dokken_sandbox]
74
77
  cleanup_dokken_sandbox
75
78
  end
76
79
 
@@ -103,6 +106,12 @@ module Kitchen
103
106
  cmd << " -F #{config[:chef_output_format]}"
104
107
  cmd << ' -c /opt/kitchen/client.rb'
105
108
  cmd << ' -j /opt/kitchen/dna.json'
109
+
110
+ chef_cmd(cmd)
111
+ end
112
+
113
+ def write_run_command(command)
114
+ File.write("#{dokken_kitchen_sandbox}/run_command", command)
106
115
  end
107
116
 
108
117
  def runner_container_name
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.8.0
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-16 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -75,7 +75,7 @@ homepage: https://github.com/someara/kitchen-dokken
75
75
  licenses:
76
76
  - Apache-2.0
77
77
  metadata: {}
78
- post_install_message:
78
+ post_install_message:
79
79
  rdoc_options: []
80
80
  require_paths:
81
81
  - lib
@@ -90,8 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.0.3
94
- signing_key:
93
+ rubygems_version: 3.1.2
94
+ signing_key:
95
95
  specification_version: 4
96
96
  summary: A Test Kitchen Driver that talks to the Docker Remote API and uses Volumes
97
97
  to produce sparse container images