kitchen-terraform 1.0.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +3 -3
  5. data/lib/kitchen/driver/terraform.rb +363 -221
  6. data/lib/kitchen/provisioner/terraform.rb +2 -3
  7. data/lib/kitchen/terraform.rb +3 -1
  8. data/lib/kitchen/terraform/clear_directory.rb +38 -0
  9. data/lib/kitchen/terraform/client/command.rb +168 -0
  10. data/lib/kitchen/terraform/client/options.rb +275 -0
  11. data/lib/kitchen/terraform/client_version_verifier.rb +57 -0
  12. data/lib/{terraform/debug_logger.rb → kitchen/terraform/config_attribute.rb} +7 -13
  13. data/lib/kitchen/terraform/config_attribute/backend_configurations.rb +53 -0
  14. data/lib/kitchen/terraform/config_attribute/color.rb +56 -0
  15. data/lib/kitchen/terraform/config_attribute/command_timeout.rb +52 -0
  16. data/lib/kitchen/terraform/config_attribute/directory.rb +54 -0
  17. data/lib/kitchen/terraform/config_attribute/groups.rb +96 -0
  18. data/lib/kitchen/terraform/config_attribute/lock_timeout.rb +52 -0
  19. data/lib/kitchen/terraform/config_attribute/parallelism.rb +53 -0
  20. data/lib/kitchen/terraform/config_attribute/plugin_directory.rb +55 -0
  21. data/lib/kitchen/terraform/config_attribute/state.rb +55 -0
  22. data/lib/kitchen/terraform/config_attribute/variable_files.rb +51 -0
  23. data/lib/kitchen/terraform/config_attribute/variables.rb +53 -0
  24. data/lib/kitchen/terraform/config_attribute/verify_plugins.rb +52 -0
  25. data/lib/kitchen/terraform/config_attribute_cacher.rb +44 -0
  26. data/lib/kitchen/terraform/config_attribute_definer.rb +66 -0
  27. data/lib/kitchen/terraform/config_predicates.rb +21 -0
  28. data/lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb +72 -0
  29. data/lib/{terraform.rb → kitchen/terraform/config_schemas.rb} +4 -2
  30. data/lib/kitchen/terraform/config_schemas/array_of_hashes_of_symbols_and_strings.rb +47 -0
  31. data/lib/kitchen/terraform/config_schemas/array_of_strings.rb +31 -0
  32. data/lib/kitchen/terraform/config_schemas/boolean.rb +27 -0
  33. data/lib/kitchen/terraform/config_schemas/hash_of_symbols_and_strings.rb +32 -0
  34. data/lib/kitchen/terraform/config_schemas/integer.rb +27 -0
  35. data/lib/kitchen/terraform/config_schemas/optional_string.rb +31 -0
  36. data/lib/kitchen/terraform/config_schemas/string.rb +26 -0
  37. data/lib/kitchen/terraform/configurable.rb +75 -0
  38. data/lib/kitchen/terraform/file_path_config_attribute_definer.rb +48 -0
  39. data/lib/{terraform/project_version.rb → kitchen/terraform/version.rb} +3 -3
  40. data/lib/kitchen/verifier/terraform.rb +40 -129
  41. data/lib/kitchen/verifier/terraform/configure_inspec_runner_attributes.rb +7 -4
  42. data/lib/kitchen/verifier/terraform/enumerate_groups_and_hostnames.rb +2 -2
  43. metadata +69 -43
  44. metadata.gz.sig +0 -0
  45. data/lib/kitchen/driver/terraform/verify_client_version.rb +0 -44
  46. data/lib/kitchen/driver/terraform/workflow.rb +0 -90
  47. data/lib/kitchen/terraform/client/apply.rb +0 -38
  48. data/lib/kitchen/terraform/client/execute_command.rb +0 -56
  49. data/lib/kitchen/terraform/client/get.rb +0 -35
  50. data/lib/kitchen/terraform/client/output.rb +0 -50
  51. data/lib/kitchen/terraform/client/plan.rb +0 -42
  52. data/lib/kitchen/terraform/client/process_options.rb +0 -87
  53. data/lib/kitchen/terraform/client/validate.rb +0 -35
  54. data/lib/kitchen/terraform/client/version.rb +0 -48
  55. data/lib/kitchen/terraform/define_config_attribute.rb +0 -39
  56. data/lib/kitchen/terraform/define_integer_config_attribute.rb +0 -43
  57. data/lib/kitchen/terraform/define_string_config_attribute.rb +0 -43
  58. data/lib/terraform/configurable.rb +0 -42
@@ -16,153 +16,65 @@
16
16
 
17
17
  require "dry/monads"
18
18
  require "kitchen"
19
- require "kitchen/terraform/define_config_attribute"
19
+ require "kitchen/terraform/config_attribute/color"
20
+ require "kitchen/terraform/config_attribute/groups"
21
+ require "kitchen/terraform/configurable"
20
22
  require "kitchen/verifier/inspec"
21
- require "terraform/configurable"
22
23
 
23
- # The verifier utilizes the InSpec infrastructure testing framework to verify the behaviour and state of resources in
24
- # the Terraform state.
24
+ # The kitchen-terraform verifier utilizes the InSpec infrastructure testing framework to verify the behaviour and state
25
+ # of resources in the Terraform state.
25
26
  #
26
- # InSpec profiles are assumed to be located in `test/integration/<suite-name>/`.
27
+ # It is a subclass of the kitchen-inspec verifier.
27
28
  #
28
- # === Configuration
29
+ # === Test Kitchen Configuration
29
30
  #
30
- # ==== Example .kitchen.yml snippet
31
+ # The configuration of the verifier is used to control the behaviour of the InSpec runner.
32
+ #
33
+ # More information about the available configuration attributes is located with the respective modules.
34
+ #
35
+ # Test Kitchen configuration is defined in +.kitchen.yml+ and optionally overridden in +.kitchen.local.yml+.
36
+ #
37
+ # ==== Example
31
38
  #
32
39
  # verifier:
33
- # name: terraform
40
+ # name: "terraform"
41
+ # color: false
34
42
  # groups:
35
- # - name: group_one
43
+ # -
44
+ # name: "group_one"
36
45
  # attributes:
37
- # foo: bar
46
+ # foo: "bar"
38
47
  # controls:
39
- # - biz
40
- # hostnames: hostnames_output
41
- # port: 123
42
- # username: test-user
43
- # - name: group_two
44
- #
45
- # ==== Attributes
46
- #
47
- # ===== groups
48
- #
49
- # Description:: A collection of maps that configure which InSpec profile will be run against different resources in the
50
- # Terraform state.
51
- #
52
- # Type:: Array
53
- #
54
- # Status:: Optional
55
- #
56
- # Default:: +[]+
57
- #
58
- # ====== name
59
- #
60
- # Description:: A label that is used to identify the group.
61
- #
62
- # Type:: String
63
- #
64
- # Status:: Required
65
- #
66
- # ====== attributes
67
- #
68
- # Description:: A map that associates InSpec profile attribute names to Terraform output variable names.
69
- #
70
- # Type:: Hash
71
- #
72
- # Status:: Optional
73
- #
74
- # Default:: +{}+
75
- #
76
- # ====== controls
77
- #
78
- # Description:: A collection of controls to selectively include from the suite's InSpec profile.
79
- #
80
- # Type:: Array
48
+ # - "biz"
49
+ # hostnames: "hostnames_output"
50
+ # port: "123"
51
+ # username: "test-user"
52
+ # -
53
+ # name: "group_two"
81
54
  #
82
- # Status:: Optional
55
+ # === InSpec Profiles
83
56
  #
84
- # Default:: +[]+
85
- #
86
- # ====== hostnames
87
- #
88
- # Description:: The name of a Terraform output variable of type String or Array which contains one or more hostnames
89
- # from the Terraform state that will be targeted with the suite's InSpec profile.
90
- #
91
- # Type:: String
92
- #
93
- # Status:: Optional
94
- #
95
- # ====== port
96
- #
97
- # Description:: The port to use when connecting to the group's hosts with Secure Shell (SSH).
98
- #
99
- # Type:: Integer
100
- #
101
- # Status:: Optional
102
- #
103
- # ====== username
104
- #
105
- # Description:: The username to use when connecting to the group's hosts with SSH.
106
- #
107
- # Type:: String
108
- #
109
- # Status:: Optional
57
+ # The InSpec profile for a Test Kitchen suite exists under +./test/integration/<Test Kitchen suite name>/+.
110
58
  #
59
+ # @see ::Kitchen::Terraform::ConfigAttribute::Color
60
+ # @see ::Kitchen::Terraform::ConfigAttribute::Groups
111
61
  # @see https://en.wikipedia.org/wiki/Secure_Shell Secure Shell
62
+ # @see https://github.com/chef/kitchen-inspec/ kitchen-inspec
63
+ # @see https://github.com/chef/kitchen-inspec/blob/master/lib/kitchen/verifier/inspec.rb kitchen-inspec: Verifier
112
64
  # @see https://www.inspec.io/ InSpec
113
- # @see https://www.inspec.io/docs/reference/dsl_inspec/ InSpec Controls
114
- # @see https://www.inspec.io/docs/reference/profiles/ InSpec Profiles
115
- # @see https://www.terraform.io/docs/configuration/outputs.html Terraform Output Variables
116
- # @see https://www.terraform.io/docs/state/index.html Terraform State
65
+ # @see https://www.inspec.io/docs/reference/profiles/ InSpec: Profiles
66
+ # @see https://www.terraform.io/docs/state/index.html Terraform: State
117
67
  # @version 2
118
68
  class ::Kitchen::Verifier::Terraform < ::Kitchen::Verifier::Inspec
119
69
  kitchen_verifier_api_version 2
120
70
 
121
- ::Kitchen::Terraform::DefineConfigAttribute.call(
122
- attribute: :groups,
123
- initialize_default_value: lambda do |_plugin|
124
- []
125
- end,
126
- plugin_class: self,
127
- schema: lambda do
128
- configure do
129
- def self.messages
130
- super.merge en: {
131
- errors: {
132
- keys_are_strings_or_symbols?: "keys must be strings or symbols",
133
- values_are_strings?: "values must be strings"
134
- }
135
- }
136
- end
137
-
138
- def keys_are_strings_or_symbols?(hash)
139
- hash.keys.all? do |key|
140
- key.is_a?(::String) | key.is_a?(::Symbol)
141
- end
142
- end
71
+ include ::Dry::Monads::Either::Mixin
143
72
 
144
- def values_are_strings?(hash)
145
- hash.values.all? do |value|
146
- value.is_a? ::String
147
- end
148
- end
149
- end
150
- required(:value).each do
151
- schema do
152
- required(:name).filled :str?
153
- optional(:attributes).value :hash?, :keys_are_strings_or_symbols?, :values_are_strings?
154
- optional(:controls).each :filled?, :str?
155
- optional(:hostnames).value :str?
156
- optional(:port).value :int?
157
- optional(:username).value :str?
158
- end
159
- end
160
- end
161
- )
73
+ include ::Kitchen::Terraform::ConfigAttribute::Color
162
74
 
163
- include ::Dry::Monads::Either::Mixin
75
+ include ::Kitchen::Terraform::ConfigAttribute::Groups
164
76
 
165
- include ::Terraform::Configurable
77
+ include ::Kitchen::Terraform::Configurable
166
78
 
167
79
  # The verifier enumerates through each hostname of each group and verifies the associated InSpec controls.
168
80
  #
@@ -172,13 +84,13 @@ class ::Kitchen::Verifier::Terraform < ::Kitchen::Verifier::Inspec
172
84
  # @raise [::Kitchen::ActionFailed] if the result of the action is a failure.
173
85
  # @return [::Dry::Monads::Either] the result of the action.
174
86
  def call(state)
175
- self.class::EnumerateGroupsAndHostnames.call driver: driver, groups: config.fetch(:groups) do |group:, hostname:|
87
+ self.class::EnumerateGroupsAndHostnames.call driver: driver, groups: config_groups do |group:, hostname:|
176
88
  state.store :group, group
177
89
  state.store :hostname, hostname
178
90
  info "Verifying host '#{hostname}' of group '#{group.fetch :name}'"
179
91
  super state
180
- end.fmap do |success|
181
- logger.debug success
92
+ end.bind do |success|
93
+ Right logger.debug success
182
94
  end.or do |failure|
183
95
  raise ::Kitchen::ActionFailed, failure
184
96
  end
@@ -192,7 +104,6 @@ class ::Kitchen::Verifier::Terraform < ::Kitchen::Verifier::Inspec
192
104
  # @api private
193
105
  # @return [::Hash] Inspec Runner options.
194
106
  # @see https://github.com/chef/inspec/blob/master/lib/inspec/runner.rb ::Inspec::Runner
195
- # @see https://github.com/chef/kitchen-inspec/blob/master/lib/kitchen/verifier.rb kitchen-inspec verifier
196
107
  def runner_options(transport, state = {}, platform = nil, suite = nil)
197
108
  super(transport, state, platform, suite).tap do |options|
198
109
  self.class::ConfigureInspecRunnerBackend.call hostname: state.fetch(:hostname), options: options
@@ -69,8 +69,11 @@ module ::Kitchen::Verifier::Terraform::ConfigureInspecRunnerAttributes
69
69
  # @return [::Dry::Monads::Either] the result of the function
70
70
  def self.call(driver:, group:, terraform_state:)
71
71
  Right("terraform_state" => terraform_state).bind do |attributes|
72
- driver.output.fmap do |output|
73
- [attributes, output]
72
+ driver.output.bind do |output|
73
+ Right [
74
+ attributes,
75
+ output
76
+ ]
74
77
  end
75
78
  end.bind do |attributes, output|
76
79
  Try ::KeyError do
@@ -79,13 +82,13 @@ module ::Kitchen::Verifier::Terraform::ConfigureInspecRunnerAttributes
79
82
  end
80
83
  [attributes, output]
81
84
  end
82
- end.fmap do |attributes, output|
85
+ end.bind do |attributes, output|
83
86
  Maybe(group[:attributes]).bind do |group_attributes|
84
87
  group_attributes.each_pair do |attribute_name, output_name|
85
88
  attributes.store attribute_name.to_s, output.fetch(output_name.to_s).fetch("value")
86
89
  end
87
90
  end
88
- attributes
91
+ Right attributes
89
92
  end.to_either.or do |error|
90
93
  Left "configuring Inspec::Runner attributes failed\n#{error}"
91
94
  end
@@ -60,8 +60,8 @@ module ::Kitchen::Verifier::Terraform::EnumerateGroupsAndHostnames
60
60
  Right block.call group: group, hostname: "localhost"
61
61
  end
62
62
  end
63
- end.fmap do
64
- "finished enumeration of groups and hostnames"
63
+ end.bind do
64
+ Right "finished enumeration of groups and hostnames"
65
65
  end
66
66
  end
67
67
  end
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: 1.0.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lane
@@ -23,28 +23,38 @@ bindir: bin
23
23
  cert_chain:
24
24
  - |
25
25
  -----BEGIN CERTIFICATE-----
26
- MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRMwEQYDVQQDDAphYXJv
26
+ MIIFjjCCA3agAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRMwEQYDVQQDDAphYXJv
27
27
  bi5sYW5lMRowGAYKCZImiZPyLGQBGRYKbmV3Y29udGV4dDETMBEGCgmSJomT8ixk
28
- ARkWA2NvbTAeFw0xNjA3MjIxODAzMzNaFw0xNzA3MjIxODAzMzNaMEYxEzARBgNV
28
+ ARkWA2NvbTAeFw0xNzA5MTQwMzMxNDJaFw0xODA5MTQwMzMxNDJaMEYxEzARBgNV
29
29
  BAMMCmFhcm9uLmxhbmUxGjAYBgoJkiaJk/IsZAEZFgpuZXdjb250ZXh0MRMwEQYK
30
- CZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
31
- 1MSucgJvoMZmrwOGvdgbtCfhnDATQk7K2ab9zskq/dCemRp3go/Zq9o7NPxP8zbo
32
- Eaek77rRQIbcVkv5afA7NchY0ndEWiESIETYTaiFDb7ayl2zSBNlffY+Ot1pYfsR
33
- DzChXPFOMWLZKTjVxSw+uP/uW5X6v/Oo1OKBVjNbOTA+bQJ8lrgAht0U/78xYQ8U
34
- 55GvbJG9JaZbKh3JQMk24I7D5Y2HS+m5heE+EcgFOjtdgVFBF8ANMOUmmuv1YfLg
35
- ZPAbqEcM2G/7FNq0CEPmcGEBcVSTmp+2yO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ZNrrmesdIpmevnCadt+vjSw7C11
52
+ vP6lkMIqRPl1kkpVbab6ljszfzZXGMsSilrbLeuC8ey+eymPhghdBM0Fxx+9zVvI
53
+ txx/nHF8OT3dFr5sni1qko0hXzKhv6OolNU+9a9CVS/+apVKRyoYu7GFFBdLBdGc
54
+ XjOfZudLs1zJ8ZNOuwj6KkGJ9J3XHd9hM95MtBEWlxAfYdCuW1+v7zCTfbieBEba
55
+ UIyyldg4TuVcuRs8uKJyempT0hqx2DniseBWw3nvtgom3A==
46
56
  -----END CERTIFICATE-----
47
- date: 2017-07-17 00:00:00.000000000 Z
57
+ date: 2017-09-14 00:00:00.000000000 Z
48
58
  dependencies:
49
59
  - !ruby/object:Gem::Dependency
50
60
  name: codeclimate-test-reporter
@@ -262,15 +272,16 @@ dependencies:
262
272
  requirements:
263
273
  - - "~>"
264
274
  - !ruby/object:Gem::Version
265
- version: '1.10'
275
+ version: 1.16.0
266
276
  type: :runtime
267
277
  prerelease: false
268
278
  version_requirements: !ruby/object:Gem::Requirement
269
279
  requirements:
270
280
  - - "~>"
271
281
  - !ruby/object:Gem::Version
272
- version: '1.10'
273
- description:
282
+ version: 1.16.0
283
+ description: kitchen-terraform is a set of Test Kitchen plugins for testing Terraform
284
+ configuration
274
285
  email: kitchen-terraform@newcontext.com
275
286
  executables: []
276
287
  extensions: []
@@ -279,23 +290,42 @@ files:
279
290
  - LICENSE
280
291
  - README.md
281
292
  - lib/kitchen/driver/terraform.rb
282
- - lib/kitchen/driver/terraform/verify_client_version.rb
283
- - lib/kitchen/driver/terraform/workflow.rb
284
293
  - lib/kitchen/provisioner/terraform.rb
285
294
  - lib/kitchen/terraform.rb
295
+ - lib/kitchen/terraform/clear_directory.rb
286
296
  - lib/kitchen/terraform/client.rb
287
- - lib/kitchen/terraform/client/apply.rb
288
- - lib/kitchen/terraform/client/execute_command.rb
289
- - lib/kitchen/terraform/client/get.rb
290
- - lib/kitchen/terraform/client/output.rb
291
- - lib/kitchen/terraform/client/plan.rb
292
- - lib/kitchen/terraform/client/process_options.rb
293
- - lib/kitchen/terraform/client/validate.rb
294
- - lib/kitchen/terraform/client/version.rb
297
+ - lib/kitchen/terraform/client/command.rb
298
+ - lib/kitchen/terraform/client/options.rb
299
+ - lib/kitchen/terraform/client_version_verifier.rb
300
+ - lib/kitchen/terraform/config_attribute.rb
301
+ - lib/kitchen/terraform/config_attribute/backend_configurations.rb
302
+ - lib/kitchen/terraform/config_attribute/color.rb
303
+ - lib/kitchen/terraform/config_attribute/command_timeout.rb
304
+ - lib/kitchen/terraform/config_attribute/directory.rb
305
+ - lib/kitchen/terraform/config_attribute/groups.rb
306
+ - lib/kitchen/terraform/config_attribute/lock_timeout.rb
307
+ - lib/kitchen/terraform/config_attribute/parallelism.rb
308
+ - lib/kitchen/terraform/config_attribute/plugin_directory.rb
309
+ - lib/kitchen/terraform/config_attribute/state.rb
310
+ - lib/kitchen/terraform/config_attribute/variable_files.rb
311
+ - lib/kitchen/terraform/config_attribute/variables.rb
312
+ - lib/kitchen/terraform/config_attribute/verify_plugins.rb
313
+ - lib/kitchen/terraform/config_attribute_cacher.rb
314
+ - lib/kitchen/terraform/config_attribute_definer.rb
315
+ - lib/kitchen/terraform/config_predicates.rb
316
+ - lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb
317
+ - lib/kitchen/terraform/config_schemas.rb
318
+ - lib/kitchen/terraform/config_schemas/array_of_hashes_of_symbols_and_strings.rb
319
+ - lib/kitchen/terraform/config_schemas/array_of_strings.rb
320
+ - lib/kitchen/terraform/config_schemas/boolean.rb
321
+ - lib/kitchen/terraform/config_schemas/hash_of_symbols_and_strings.rb
322
+ - lib/kitchen/terraform/config_schemas/integer.rb
323
+ - lib/kitchen/terraform/config_schemas/optional_string.rb
324
+ - lib/kitchen/terraform/config_schemas/string.rb
325
+ - lib/kitchen/terraform/configurable.rb
295
326
  - lib/kitchen/terraform/create_directories.rb
296
- - lib/kitchen/terraform/define_config_attribute.rb
297
- - lib/kitchen/terraform/define_integer_config_attribute.rb
298
- - lib/kitchen/terraform/define_string_config_attribute.rb
327
+ - lib/kitchen/terraform/file_path_config_attribute_definer.rb
328
+ - lib/kitchen/terraform/version.rb
299
329
  - lib/kitchen/verifier/terraform.rb
300
330
  - lib/kitchen/verifier/terraform/configure_inspec_runner_attributes.rb
301
331
  - lib/kitchen/verifier/terraform/configure_inspec_runner_backend.rb
@@ -304,10 +334,6 @@ files:
304
334
  - lib/kitchen/verifier/terraform/configure_inspec_runner_port.rb
305
335
  - lib/kitchen/verifier/terraform/configure_inspec_runner_user.rb
306
336
  - lib/kitchen/verifier/terraform/enumerate_groups_and_hostnames.rb
307
- - lib/terraform.rb
308
- - lib/terraform/configurable.rb
309
- - lib/terraform/debug_logger.rb
310
- - lib/terraform/project_version.rb
311
337
  homepage: https://github.com/newcontext-oss/kitchen-terraform
312
338
  licenses:
313
339
  - Apache-2.0
@@ -330,10 +356,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
356
  - !ruby/object:Gem::Version
331
357
  version: '0'
332
358
  requirements:
333
- - Terraform >= 0.7, < 0.10
359
+ - Terraform ~> 0.10.2
334
360
  rubyforge_project:
335
- rubygems_version: 2.6.11
361
+ rubygems_version: 2.6.13
336
362
  signing_key:
337
363
  specification_version: 4
338
- summary: Test Kitchen plugins for testing Terraform projects
364
+ summary: Test Kitchen plugins for testing Terraform configuration
339
365
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,44 +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 "dry/monads"
18
- require "kitchen/driver/terraform"
19
-
20
- # Verifies that the provided Terraform Client version is supported.
21
- #
22
- # Supported:: Terraform version 0.9.
23
- #
24
- # Deprecated:: Terraform versions 0.7 and 0.8.
25
- #
26
- # Not Supported:: Terraform versions 0.6 and older.
27
- module ::Kitchen::Driver::Terraform::VerifyClientVersion
28
- extend ::Dry::Monads::Either::Mixin
29
-
30
- # Invokes the function.
31
- #
32
- # @param version [::Float] the Terraform Client version.
33
- # @return [::Dry::Monads::Either] the result of the function.
34
- def self.call(version:)
35
- if version == 0.9
36
- Right "Terraform version #{version} is supported"
37
- elsif (0.7..0.8).cover? version
38
- Right "Terraform version #{version} is deprecated and will not be supported by kitchen-terraform version " \
39
- "2.0; upgrade to Terraform version 0.9 to remain supported"
40
- else
41
- Left "Terraform version #{version} is not supported; supported Terraform versions are 0.7 through 0.9"
42
- end
43
- end
44
- end