kitchen-terraform 4.1.1 → 4.2.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: 79ce2705435a58ee12d82ba7b32f8a65e4af772d5d9acbb5097778876ed827e8
4
- data.tar.gz: 9230772270bc048ca54b3b2ae6f99e34d6b9cd0095f2233f74163bc687bb94aa
3
+ metadata.gz: 4440d061c4d94bbeac36416efd164b94edff6ca5347409a754a3b41c3893a8b4
4
+ data.tar.gz: d8dea88d831c64d1c72711aa1a1d400a0d3b6c3474453a53c46ecf8c19f767b9
5
5
  SHA512:
6
- metadata.gz: b5d4447b9a4a6acb2f0ac8350480d7c738196d43fa97a3f41ac2d9997e2489ea41fca77fde8bdc525bbd4f720d34b7cd9cf446627d84a3827813b23a195e58e5
7
- data.tar.gz: 05adc213a57fd1c82bbc505dbd1ad8d5b32337058ba8a6b368ac2b213d491f6392839d42b213a858d5aecb9e943c658c9372af4e20407b7f0b8f0751174963f1
6
+ metadata.gz: 73dfd7d60e26d4d79c5ea0d5212e5069b87cd171bb3480abd955b6fd66580ba5cad6bbf4ec483c3069d4b51a4a4eea3f712aa452dbc97c791a902ac4454f937e
7
+ data.tar.gz: dc37c54cdc9f4f465444ee9dadd8ef3c4da7328e0d8b8b3a7e2fa9ccc28aaa02ae07a4b923479892542630fde0c9e7d6bce8c874b91cd1e0b93a053b43d6e4ea
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
 
17
17
  require "kitchen"
18
- require "kitchen/terraform/client_version_verifier"
19
18
  require "kitchen/terraform/command/output"
19
+ require "kitchen/terraform/command/version"
20
20
  require "kitchen/terraform/config_attribute/backend_configurations"
21
21
  require "kitchen/terraform/config_attribute/color"
22
22
  require "kitchen/terraform/config_attribute/command_timeout"
@@ -27,9 +27,12 @@ require "kitchen/terraform/config_attribute/plugin_directory"
27
27
  require "kitchen/terraform/config_attribute/root_module_directory"
28
28
  require "kitchen/terraform/config_attribute/variable_files"
29
29
  require "kitchen/terraform/config_attribute/variables"
30
+ require "kitchen/terraform/config_attribute/verify_version"
30
31
  require "kitchen/terraform/configurable"
31
32
  require "kitchen/terraform/shell_out"
33
+ require "kitchen/terraform/verify_version"
32
34
  require "shellwords"
35
+ require "tty/which"
33
36
 
34
37
  # This namespace is defined by Kitchen.
35
38
  #
@@ -170,6 +173,10 @@ end
170
173
  #
171
174
  # {include:Kitchen::Terraform::ConfigAttribute::Variables}
172
175
  #
176
+ # ==== verify_version
177
+ #
178
+ # {include:Kitchen::Terraform::ConfigAttribute::VerifyVersion}
179
+ #
173
180
  # @example Describe the create command
174
181
  # kitchen help create
175
182
  # @example Create a Test Kitchen instance
@@ -209,18 +216,21 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
209
216
 
210
217
  include ::Kitchen::Terraform::ConfigAttribute::Variables
211
218
 
219
+ include ::Kitchen::Terraform::ConfigAttribute::VerifyVersion
220
+
212
221
  include ::Kitchen::Terraform::Configurable
213
222
 
214
223
  # Applies changes to the state by selecting the test workspace, updating the dependency modules, validating the root
215
224
  # module, and applying the state changes.
216
225
  #
217
- # @raise [::Kitchen::Terraform::Error] if one of the steps fails.
226
+ # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
218
227
  # @return [void]
219
228
  def apply(&block)
229
+ verify_version
220
230
  run_workspace_select_instance
221
- apply_run_get
222
- apply_run_validate
223
- apply_run_apply
231
+ apply_run
232
+ rescue ::Kitchen::Terraform::Error => error
233
+ raise ::Kitchen::ActionFailed, error.message
224
234
  end
225
235
 
226
236
  # Creates a Test Kitchen instance by initializing the working directory and creating a test workspace.
@@ -229,13 +239,11 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
229
239
  # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
230
240
  # @return [void]
231
241
  def create(_state)
242
+ verify_version
232
243
  create_run_init
233
244
  run_workspace_select_instance
234
245
  rescue ::Kitchen::Terraform::Error => error
235
- raise(
236
- ::Kitchen::ActionFailed,
237
- error.message
238
- )
246
+ raise ::Kitchen::ActionFailed, error.message
239
247
  end
240
248
 
241
249
  # Destroys a Test Kitchen instance by initializing the working directory, selecting the test workspace,
@@ -245,22 +253,20 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
245
253
  # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
246
254
  # @return [void]
247
255
  def destroy(_state)
256
+ verify_version
248
257
  destroy_run_init
249
258
  run_workspace_select_instance
250
259
  destroy_run_destroy
251
260
  destroy_run_workspace_select_default
252
261
  destroy_run_workspace_delete_instance
253
262
  rescue ::Kitchen::Terraform::Error => error
254
- raise(
255
- ::Kitchen::ActionFailed,
256
- error.message
257
- )
263
+ raise ::Kitchen::ActionFailed, error.message
258
264
  end
259
265
 
260
266
  # Retrieves the Terraform state outputs for a Kitchen instance by selecting the test workspace and fetching the
261
267
  # outputs.
262
268
  #
263
- # @raise [::Kitchen::Terraform::Error] if the retrieval fails.
269
+ # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
264
270
  # @return [void]
265
271
  # @yieldparam output [::Hash] the state output.
266
272
  def retrieve_outputs(&block)
@@ -270,29 +276,28 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
270
276
  cwd: config_root_module_directory, live_stream: logger, timeout: config_command_timeout,
271
277
  }, &block
272
278
  )
279
+ rescue ::Kitchen::Terraform::Error => error
280
+ raise ::Kitchen::ActionFailed, error.message
273
281
  end
274
282
 
275
- # Verifies that the Terraform version available to the driver is supported.
283
+ # Verifies that the Terraform CLI is on the PATH.
276
284
  #
277
- # @raise [::Kitchen::UserError] if the version is not supported.
285
+ # @raise [::Kitchen::UserError] if the Terraform CLI is not available.
278
286
  # @return [void]
279
287
  def verify_dependencies
280
- logger.warn ::Kitchen::Terraform::ClientVersionVerifier.new.verify(
281
- version_output: ::Kitchen::Terraform::ShellOut.run(
282
- command: "version",
283
- options: {
284
- cwd: ::Dir.pwd,
285
- live_stream: logger,
286
- timeout: 600,
287
- },
288
- ),
289
- )
290
- rescue ::Kitchen::Terraform::Error => error
291
- raise ::Kitchen::UserError, error.message
288
+ if !::TTY::Which.exist? "terraform"
289
+ raise ::Kitchen::UserError, "The Terraform CLI was not found on the PATH"
290
+ end
292
291
  end
293
292
 
294
293
  private
295
294
 
295
+ def apply_run
296
+ apply_run_get
297
+ apply_run_validate
298
+ apply_run_apply
299
+ end
300
+
296
301
  # @api private
297
302
  def apply_run_apply
298
303
  ::Kitchen::Terraform::ShellOut.run(
@@ -368,7 +373,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
368
373
  "#{backend_configurations_flags} " \
369
374
  "-get=true " \
370
375
  "-get-plugins=true " \
371
- "#{plugin_directory_flag} " \
376
+ "#{plugin_directory_flag}" \
372
377
  "-verify-plugins=true",
373
378
  options: {
374
379
  cwd: config_root_module_directory,
@@ -412,7 +417,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
412
417
  "#{backend_configurations_flags} " \
413
418
  "-get=true " \
414
419
  "-get-plugins=true " \
415
- "#{plugin_directory_flag} " \
420
+ "#{plugin_directory_flag}" \
416
421
  "-verify-plugins=true",
417
422
  options: {
418
423
  cwd: config_root_module_directory,
@@ -464,17 +469,12 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
464
469
  # @api private
465
470
  def plugin_directory_flag
466
471
  if config_plugin_directory
467
- "-plugin-dir=\"#{::Shellwords.shelljoin ::Shellwords.shellsplit config_plugin_directory}\""
472
+ "-plugin-dir=\"#{::Shellwords.shelljoin ::Shellwords.shellsplit config_plugin_directory}\" "
468
473
  else
469
474
  ""
470
475
  end
471
476
  end
472
477
 
473
- # @api private
474
- def root_module_directory
475
- ::Shellwords.escape config_root_module_directory
476
- end
477
-
478
478
  # @api private
479
479
  def run_workspace_select_instance
480
480
  ::Kitchen::Terraform::ShellOut.run(
@@ -510,6 +510,14 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
510
510
  end.join " "
511
511
  end
512
512
 
513
+ def verify_version
514
+ if config_verify_version
515
+ ::Kitchen::Terraform::VerifyVersion.call
516
+ else
517
+ logger.warn "Verification of support for the available version of Terraform is disabled"
518
+ end
519
+ end
520
+
513
521
  def workspace_name
514
522
  @workspace_name ||= "kitchen-terraform-#{::Shellwords.escape instance.name}"
515
523
  end
@@ -90,10 +90,5 @@ class ::Kitchen::Provisioner::Terraform < ::Kitchen::Provisioner::Base
90
90
  # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
91
91
  def call(_state)
92
92
  instance.driver.apply
93
- rescue ::Kitchen::Terraform::Error => error
94
- raise(
95
- ::Kitchen::ActionFailed,
96
- error.message
97
- )
98
93
  end
99
94
  end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2016 New Context Services, Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "kitchen"
18
+ require "kitchen/terraform/error"
19
+ require "rubygems"
20
+
21
+ module Kitchen
22
+ module Terraform
23
+ module Command
24
+ # Version is the class of objects which represent the <tt>terraform version</tt> command.
25
+ class Version < ::Gem::Version
26
+ extend ::Kitchen::Logging
27
+ extend ::Kitchen::ShellOut
28
+
29
+ class << self
30
+ # The command is run by shelling out in an environment which is optimized for automating Terraform.
31
+ #
32
+ # @raise [::Kitchen::Terraform::Error] if the result of running the command is a failure.
33
+ # @return [::Kitchen::Terraform::Command::Version] an instance initialized with the output of the command.
34
+ # @yieldparam version [::Kitchen::Terraform::Command::Version] an instance initialized with the output of the
35
+ # command.
36
+ def run
37
+ new(
38
+ run_command(
39
+ "terraform version",
40
+ environment: {
41
+ "LC_ALL" => nil,
42
+ "TF_IN_AUTOMATION" => "true",
43
+ "TF_WARN_OUTPUT_ERRORS" => "true",
44
+ },
45
+ )
46
+ ).tap do |version|
47
+ yield version: version
48
+ end
49
+ rescue ::Kitchen::ShellOut::ShellCommandFailed, ::Kitchen::Error => error
50
+ raise ::Kitchen::Terraform::Error, error.message
51
+ end
52
+
53
+ def logger
54
+ ::Kitchen.logger
55
+ end
56
+ end
57
+
58
+ private
59
+
60
+ def initialize(version)
61
+ super version.slice(/Terraform v(\d+\.\d+\.\d+)/, 1)
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2016 New Context Services, Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "kitchen"
18
+ require "kitchen/terraform/config_attribute"
19
+ require "kitchen/terraform/config_schemas/boolean"
20
+
21
+ # This attribute toggles verification of support for the available Terraform version.
22
+ #
23
+ # Type:: {http://www.yaml.org/spec/1.2/spec.html#id2803629 Boolean}
24
+ # Required:: False
25
+ # Default:: +true+
26
+ # Example:: <tt>lock: false</tt>
27
+ module ::Kitchen::Terraform::ConfigAttribute::VerifyVersion
28
+ ::Kitchen::Terraform::ConfigAttribute.new(
29
+ attribute: :verify_version,
30
+ default_value: lambda do
31
+ true
32
+ end,
33
+ schema: ::Kitchen::Terraform::ConfigSchemas::Boolean,
34
+ ).apply config_attribute: self
35
+ end
@@ -239,7 +239,7 @@ module Kitchen
239
239
  # identity files) for {https://linux.die.net/man/1/ssh Secure Shell (SSH) authentication} with hosts in the
240
240
  # Terraform state.
241
241
  #
242
- # The +key_files+ key must be used in combination with +backend: ssh+.
242
+ # The +key_files+ key must be used in combination with <tt>backend: ssh</tt>.
243
243
  #
244
244
  # <em>Example kitchen.yml</em>
245
245
  # verifier:
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2016 New Context Services, Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "kitchen/terraform"
18
+ require "kitchen/terraform/command/version"
19
+ require "kitchen/terraform/error"
20
+ require "rubygems"
21
+
22
+ # Verifies that the output of the Terraform version command indicates a supported version of Terraform.
23
+ #
24
+ # Supported:: Terraform version >= 0.11.4, < 0.12.0.
25
+ module ::Kitchen::Terraform::VerifyVersion
26
+ class << self
27
+ # Runs the function.
28
+ #
29
+ # @raise [::Kitchen::Terraform::Error] if the version is not supported or `terraform version` fails.
30
+ # @return [void]
31
+ def call
32
+ ::Kitchen::Terraform::Command::Version.run do |version:|
33
+ if !::Gem::Requirement.new(">= 0.11.4", "< 0.12.0").satisfied_by? version
34
+ raise ::Kitchen::Terraform::Error, "Terraform v#{version} is not supported; install Terraform ~> v0.11.4"
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -72,7 +72,7 @@ module ::Kitchen::Terraform::Version
72
72
 
73
73
  # @api private
74
74
  def value
75
- self.value = ::Gem::Version.new "4.1.1" if not @value
75
+ self.value = ::Gem::Version.new "4.2.0" if not @value
76
76
  @value
77
77
  end
78
78
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lane
@@ -26,38 +26,42 @@ bindir: bin
26
26
  cert_chain:
27
27
  - |
28
28
  -----BEGIN CERTIFICATE-----
29
- MIIFcjCCA1qgAwIBAgIBATANBgkqhkiG9w0BAQsFADAxMS8wLQYDVQQDDCZraXRj
30
- aGVuLXRlcnJhZm9ybS9EQz1uZXdjb250ZXh0L0RDPWNvbTAeFw0xODA5MTYxNTA5
31
- MzZaFw0xOTA5MTYxNTA5MzZaMDExLzAtBgNVBAMMJmtpdGNoZW4tdGVycmFmb3Jt
32
- L0RDPW5ld2NvbnRleHQvREM9Y29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
33
- CgKCAgEA6SlE8WTS9Jx2647BAxjQNp8rmt4503z3MNZDN2Ee2xOi/9BLTrRNDEEN
34
- 3KL06ekN3a1KoEQv4Q34w3RJYUZTTH8758+X586wcpE4OSBpKmCmnnvnCQ41AmAg
35
- mulx3a23eon/4r6QDaOet7GOW8HMlKSLokyAGlqqkJKasiAtYF8c1RBt4PRb7sps
36
- OyD1fx6d2dOsEe8nC5AE+JUVLb51aXCaeBGr8kxJLBkPvOouI2fZxnh3T7IbKhJg
37
- Hi0G4FU25p2nKeqcJkeGw8ZuVO58ttb4HELYgZgyr+WzhBjGaPLIF9sUvT0ou+fe
38
- Y67/Ds+KE6ibwNPxBZra5x9wqeBoIKFu56CrTzBCL6EpY+gfhPSn2evJujccBjUc
39
- Ri1w+V7zeRjYOQaTg1OzJC8ZaGSVi8F69v7WSLwQKKn1NJtrGHzz3i1q/0vsin8W
40
- L7qluYh/fjt+vfqS0FB8CWZnXchO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OOaIXLmp9CjUN0KRRJHTOWPKgkU1TVxVPvX/4R4B421McjlfLuMgo
59
+ LTJJaKnieViDrlLGkYE0JGxEHXNvwA7JcBBaKFctUOig9RVJtlqZJqU1iu9lj+Wk
60
+ Tp0eCqWr0dy8uZBSPlRKsiQJsF32Ol2YZuAZF8UuPsgmxP38palsFeZziMd+tAp6
61
+ XAjP/LERlXAwM+NCUycJw7BZMn7L2wIdnq6Le1rL6VJS17CZt2heuRtsF+3g0egR
62
+ x97GmUumeM67PGeVodlIV65tdXrdlqKlHcE=
59
63
  -----END CERTIFICATE-----
60
- date: 2018-12-13 00:00:00.000000000 Z
64
+ date: 2018-12-30 00:00:00.000000000 Z
61
65
  dependencies:
62
66
  - !ruby/object:Gem::Dependency
63
67
  name: guard
@@ -353,6 +357,20 @@ dependencies:
353
357
  - - "~>"
354
358
  - !ruby/object:Gem::Version
355
359
  version: '1.23'
360
+ - !ruby/object:Gem::Dependency
361
+ name: tty-which
362
+ requirement: !ruby/object:Gem::Requirement
363
+ requirements:
364
+ - - "~>"
365
+ - !ruby/object:Gem::Version
366
+ version: 0.4.0
367
+ type: :runtime
368
+ prerelease: false
369
+ version_requirements: !ruby/object:Gem::Requirement
370
+ requirements:
371
+ - - "~>"
372
+ - !ruby/object:Gem::Version
373
+ version: 0.4.0
356
374
  description: kitchen-terraform is a set of Test Kitchen plugins for testing Terraform
357
375
  configuration
358
376
  email: kitchen-terraform@newcontext.com
@@ -366,9 +384,9 @@ files:
366
384
  - lib/kitchen/provisioner/terraform.rb
367
385
  - lib/kitchen/terraform.rb
368
386
  - lib/kitchen/terraform/breaking.rb
369
- - lib/kitchen/terraform/client_version_verifier.rb
370
387
  - lib/kitchen/terraform/command.rb
371
388
  - lib/kitchen/terraform/command/output.rb
389
+ - lib/kitchen/terraform/command/version.rb
372
390
  - lib/kitchen/terraform/config_attribute.rb
373
391
  - lib/kitchen/terraform/config_attribute/backend_configurations.rb
374
392
  - lib/kitchen/terraform/config_attribute/color.rb
@@ -381,6 +399,7 @@ files:
381
399
  - lib/kitchen/terraform/config_attribute/systems.rb
382
400
  - lib/kitchen/terraform/config_attribute/variable_files.rb
383
401
  - lib/kitchen/terraform/config_attribute/variables.rb
402
+ - lib/kitchen/terraform/config_attribute/verify_version.rb
384
403
  - lib/kitchen/terraform/config_attribute_cacher.rb
385
404
  - lib/kitchen/terraform/config_attribute_definer.rb
386
405
  - lib/kitchen/terraform/config_attribute_type.rb
@@ -407,6 +426,7 @@ files:
407
426
  - lib/kitchen/terraform/system.rb
408
427
  - lib/kitchen/terraform/system_attrs_resolver.rb
409
428
  - lib/kitchen/terraform/system_hosts_resolver.rb
429
+ - lib/kitchen/terraform/verify_version.rb
410
430
  - lib/kitchen/terraform/version.rb
411
431
  - lib/kitchen/verifier/terraform.rb
412
432
  homepage: https://newcontext-oss.github.io/kitchen-terraform/
@@ -424,7 +444,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
424
444
  version: '2.3'
425
445
  - - "<"
426
446
  - !ruby/object:Gem::Version
427
- version: '2.6'
447
+ version: '2.7'
428
448
  required_rubygems_version: !ruby/object:Gem::Requirement
429
449
  requirements:
430
450
  - - ">="
@@ -432,8 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
432
452
  version: '0'
433
453
  requirements:
434
454
  - Terraform >= 0.11.4, < 0.12.0
435
- rubyforge_project:
436
- rubygems_version: 2.7.8
455
+ rubygems_version: 3.0.1
437
456
  signing_key:
438
457
  specification_version: 4
439
458
  summary: Test Kitchen plugins for testing Terraform configuration
metadata.gz.sig CHANGED
Binary file
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016 New Context Services, Inc.
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require "kitchen/terraform"
18
- require "kitchen/terraform/error"
19
- require "rubygems"
20
-
21
- # Verifies that the output of the Terraform version command indicates a supported version of Terraform.
22
- #
23
- # Supported:: Terraform version >= 0.11.4, < 0.12.0.
24
- class ::Kitchen::Terraform::ClientVersionVerifier
25
- # Verifies output from the Terraform version command against the support version.
26
- #
27
- # @param version_output [::String] the Terraform Client version subcommand output.
28
- # @raise [::Kitchen::Terraform::Error] if the version is not supported.
29
- # @return [::String] a confirmation that the version is supported.
30
- def verify(version_output:)
31
- ::Gem::Version
32
- .new(
33
- version_output
34
- .slice(
35
- /v(\d+\.\d+\.\d+)/,
36
- 1
37
- )
38
- )
39
- .tap do |version|
40
- requirement
41
- .satisfied_by? version or
42
- raise(
43
- ::Kitchen::Terraform::Error,
44
- "Terraform v#{version} is not supported; install Terraform ~> v0.11.4"
45
- )
46
-
47
- return "Terraform v#{version} is supported"
48
- end
49
- end
50
-
51
- private
52
-
53
- attr_reader :requirement
54
-
55
- # @api private
56
- def initialize
57
- @requirement =
58
- ::Gem::Requirement
59
- .new(
60
- ">= 0.11.4",
61
- "< 0.12.0"
62
- )
63
- end
64
- end