kitchen-terraform 5.6.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) 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 +19 -19
  5. data/lib/kitchen/driver/terraform.rb +1 -1
  6. data/lib/kitchen/provisioner/terraform.rb +1 -1
  7. data/lib/kitchen/terraform.rb +1 -1
  8. data/lib/kitchen/terraform/breaking.rb +1 -1
  9. data/lib/kitchen/terraform/command.rb +1 -1
  10. data/lib/kitchen/terraform/command/apply.rb +1 -1
  11. data/lib/kitchen/terraform/command/destroy.rb +1 -1
  12. data/lib/kitchen/terraform/command/get.rb +1 -1
  13. data/lib/kitchen/terraform/command/init.rb +3 -80
  14. data/lib/kitchen/terraform/command/init/post_zero_fifteen_zero.rb +89 -0
  15. data/lib/kitchen/terraform/command/init/pre_zero_fifteen_zero.rb +101 -0
  16. data/lib/kitchen/terraform/command/init_factory.rb +52 -0
  17. data/lib/kitchen/terraform/command/output.rb +1 -1
  18. data/lib/kitchen/terraform/command/validate.rb +3 -41
  19. data/lib/kitchen/terraform/command/validate/post_zero_fifteen_zero.rb +51 -0
  20. data/lib/kitchen/terraform/command/validate/pre_zero_fifteen_zero.rb +65 -0
  21. data/lib/kitchen/terraform/command/validate_factory.rb +54 -0
  22. data/lib/kitchen/terraform/command/version.rb +1 -1
  23. data/lib/kitchen/terraform/command/workspace_delete.rb +1 -1
  24. data/lib/kitchen/terraform/command/workspace_new.rb +1 -1
  25. data/lib/kitchen/terraform/command/workspace_select.rb +1 -1
  26. data/lib/kitchen/terraform/command_executor.rb +3 -5
  27. data/lib/kitchen/terraform/command_flag.rb +1 -1
  28. data/lib/kitchen/terraform/command_flag/backend_config.rb +1 -1
  29. data/lib/kitchen/terraform/command_flag/color.rb +1 -1
  30. data/lib/kitchen/terraform/command_flag/lock_timeout.rb +1 -1
  31. data/lib/kitchen/terraform/command_flag/plugin_dir.rb +1 -1
  32. data/lib/kitchen/terraform/command_flag/upgrade.rb +2 -2
  33. data/lib/kitchen/terraform/command_flag/var.rb +1 -1
  34. data/lib/kitchen/terraform/command_flag/var_file.rb +1 -1
  35. data/lib/kitchen/terraform/config_attribute.rb +1 -1
  36. data/lib/kitchen/terraform/config_attribute/backend_configurations.rb +1 -1
  37. data/lib/kitchen/terraform/config_attribute/client.rb +3 -3
  38. data/lib/kitchen/terraform/config_attribute/color.rb +3 -3
  39. data/lib/kitchen/terraform/config_attribute/command_timeout.rb +1 -1
  40. data/lib/kitchen/terraform/config_attribute/fail_fast.rb +3 -3
  41. data/lib/kitchen/terraform/config_attribute/lock.rb +3 -3
  42. data/lib/kitchen/terraform/config_attribute/lock_timeout.rb +1 -1
  43. data/lib/kitchen/terraform/config_attribute/parallelism.rb +1 -1
  44. data/lib/kitchen/terraform/config_attribute/plugin_directory.rb +3 -3
  45. data/lib/kitchen/terraform/config_attribute/root_module_directory.rb +3 -3
  46. data/lib/kitchen/terraform/config_attribute/systems.rb +552 -4
  47. data/lib/kitchen/terraform/config_attribute/variable_files.rb +3 -3
  48. data/lib/kitchen/terraform/config_attribute/variables.rb +1 -1
  49. data/lib/kitchen/terraform/config_attribute/verify_version.rb +3 -3
  50. data/lib/kitchen/terraform/config_attribute_cacher.rb +1 -1
  51. data/lib/kitchen/terraform/{config_predicates.rb → config_attribute_contract.rb} +3 -3
  52. data/lib/kitchen/terraform/config_attribute_contract/array_of_strings.rb +30 -0
  53. data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/boolean.rb +7 -11
  54. data/lib/kitchen/terraform/config_attribute_contract/hash_of_symbols_and_strings.rb +41 -0
  55. data/lib/kitchen/terraform/{config_schemas.rb → config_attribute_contract/integer.rb} +10 -3
  56. data/lib/kitchen/terraform/config_attribute_contract/optional_string.rb +30 -0
  57. data/lib/kitchen/terraform/{config_schemas → config_attribute_contract}/string.rb +7 -9
  58. data/lib/kitchen/terraform/config_attribute_contract/systems.rb +63 -0
  59. data/lib/kitchen/terraform/config_attribute_definer.rb +2 -2
  60. data/lib/kitchen/terraform/config_attribute_type.rb +1 -1
  61. data/lib/kitchen/terraform/config_attribute_type/hash_of_symbols_and_strings.rb +9 -16
  62. data/lib/kitchen/terraform/config_attribute_type/integer.rb +27 -23
  63. data/lib/kitchen/terraform/configurable.rb +2 -2
  64. data/lib/kitchen/terraform/debug_logger.rb +1 -1
  65. data/lib/kitchen/terraform/deprecating.rb +1 -1
  66. data/lib/kitchen/terraform/driver.rb +1 -1
  67. data/lib/kitchen/terraform/driver/create.rb +39 -16
  68. data/lib/kitchen/terraform/driver/destroy.rb +53 -21
  69. data/lib/kitchen/terraform/error.rb +1 -1
  70. data/lib/kitchen/terraform/file_path_config_attribute_definer.rb +1 -1
  71. data/lib/kitchen/terraform/inspec.rb +1 -1
  72. data/lib/kitchen/terraform/inspec/fail_fast_with_hosts.rb +1 -1
  73. data/lib/kitchen/terraform/inspec/fail_slow_with_hosts.rb +1 -1
  74. data/lib/kitchen/terraform/inspec/without_hosts.rb +1 -1
  75. data/lib/kitchen/terraform/inspec_factory.rb +1 -1
  76. data/lib/kitchen/terraform/inspec_options_factory.rb +1 -1
  77. data/lib/kitchen/terraform/inspec_runner.rb +8 -1
  78. data/lib/kitchen/terraform/outputs_manager.rb +1 -1
  79. data/lib/kitchen/terraform/outputs_parser.rb +1 -1
  80. data/lib/kitchen/terraform/outputs_reader.rb +2 -2
  81. data/lib/kitchen/terraform/provisioner.rb +1 -1
  82. data/lib/kitchen/terraform/provisioner/converge.rb +52 -25
  83. data/lib/kitchen/terraform/raise.rb +1 -1
  84. data/lib/kitchen/terraform/raise/action_failed.rb +1 -1
  85. data/lib/kitchen/terraform/raise/client_error.rb +1 -1
  86. data/lib/kitchen/terraform/shell_out.rb +6 -5
  87. data/lib/kitchen/terraform/system.rb +1 -1
  88. data/lib/kitchen/terraform/system_attrs_inputs_resolver.rb +1 -1
  89. data/lib/kitchen/terraform/system_attrs_outputs_resolver.rb +1 -1
  90. data/lib/kitchen/terraform/system_bastion_host_resolver.rb +1 -1
  91. data/lib/kitchen/terraform/system_hosts_resolver.rb +1 -1
  92. data/lib/kitchen/terraform/system_inspec_map.rb +1 -1
  93. data/lib/kitchen/terraform/systems_verifier.rb +1 -1
  94. data/lib/kitchen/terraform/systems_verifier/fail_fast.rb +1 -1
  95. data/lib/kitchen/terraform/systems_verifier/fail_slow.rb +1 -1
  96. data/lib/kitchen/terraform/systems_verifier_factory.rb +1 -1
  97. data/lib/kitchen/terraform/unsupported_client_version_error.rb +1 -1
  98. data/lib/kitchen/terraform/variables_manager.rb +1 -1
  99. data/lib/kitchen/terraform/verify_version.rb +5 -17
  100. data/lib/kitchen/terraform/verify_version_rescue_strategy.rb +1 -1
  101. data/lib/kitchen/terraform/verify_version_rescue_strategy/permissive.rb +1 -1
  102. data/lib/kitchen/terraform/verify_version_rescue_strategy/strict.rb +1 -1
  103. data/lib/kitchen/terraform/verify_version_rescue_strategy_factory.rb +1 -1
  104. data/lib/kitchen/terraform/version.rb +2 -2
  105. data/lib/kitchen/terraform/version_verifier.rb +1 -1
  106. data/lib/kitchen/terraform/version_verifier_strategy.rb +1 -1
  107. data/lib/kitchen/terraform/version_verifier_strategy/supported.rb +1 -1
  108. data/lib/kitchen/terraform/version_verifier_strategy/unsupported.rb +1 -1
  109. data/lib/kitchen/terraform/version_verifier_strategy_factory.rb +1 -1
  110. data/lib/kitchen/verifier/terraform.rb +1 -1
  111. metadata +88 -53
  112. metadata.gz.sig +0 -0
  113. data/lib/kitchen/terraform/config_predicates/hash_of_symbols_and_strings.rb +0 -81
  114. data/lib/kitchen/terraform/config_schemas/array_of_strings.rb +0 -38
  115. data/lib/kitchen/terraform/config_schemas/optional_string.rb +0 -38
  116. data/lib/kitchen/terraform/config_schemas/system.rb +0 -609
  117. data/lib/kitchen/terraform/config_schemas/systems.rb +0 -37
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ module Kitchen
42
42
  # @see Kitchen::Configurable#finalize_config!
43
43
  def finalize_config!(instance)
44
44
  super instance
45
- self.version_requirement = ::Gem::Requirement.new ">= 0.11.4", "< 0.15.0"
45
+ self.version_requirement = ::Gem::Requirement.new ">= 0.11.4", "< 1.1.0"
46
46
  self.workspace_name = "kitchen-terraform-#{::Shellwords.escape instance.name}"
47
47
  end
48
48
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,12 +15,13 @@
15
15
  # limitations under the License.
16
16
 
17
17
  require "kitchen"
18
- require "kitchen/terraform/command/init"
18
+ require "kitchen/terraform/command/init_factory"
19
19
  require "kitchen/terraform/command/version"
20
20
  require "kitchen/terraform/command/workspace_new"
21
21
  require "kitchen/terraform/command/workspace_select"
22
22
  require "kitchen/terraform/command_executor"
23
23
  require "kitchen/terraform/verify_version"
24
+ require "rubygems"
24
25
 
25
26
  module Kitchen
26
27
  module Terraform
@@ -29,7 +30,13 @@ module Kitchen
29
30
  #
30
31
  # ===== Initializing the Terraform Working Directory
31
32
  #
32
- # {include:Kitchen::Terraform::Command::Init}
33
+ # ====== Terraform >= 0.15.0
34
+ #
35
+ # {include:Kitchen::Terraform::Command::Init::PostZeroFifteenZero}
36
+ #
37
+ # ====== Terraform < 0.15.0
38
+ #
39
+ # {include:Kitchen::Terraform::Command::Init::PreZeroFifteenZero}
33
40
  #
34
41
  # ===== Creating or Selecting the Test Terraform Workspace
35
42
  #
@@ -42,7 +49,8 @@ module Kitchen
42
49
  # @raise [Kitchen::TransientFailure] if a command fails.
43
50
  # @return [self]
44
51
  def call
45
- verify_version.call command: version, options: options
52
+ read_client_version
53
+ verify_version.call version: client_version
46
54
  initialize_directory
47
55
  create_or_select_workspace
48
56
 
@@ -58,20 +66,22 @@ module Kitchen
58
66
  # @option config [String] :client the pathname of the Terraform client.
59
67
  # @return [Kitchen::Terraform::Driver::Create]
60
68
  def initialize(config:, logger:, version_requirement:, workspace_name:)
61
- hash_config = config.to_hash.merge upgrade_during_init: true, workspace_name: workspace_name
69
+ self.complete_config = config.to_hash.merge upgrade_during_init: true, workspace_name: workspace_name
70
+ self.client_version = ::Gem::Version.new "0.0.0"
62
71
  self.command_executor = ::Kitchen::Terraform::CommandExecutor.new(
63
- client: config.fetch(:client),
72
+ client: complete_config.fetch(:client),
64
73
  logger: logger,
65
74
  )
66
- self.init = ::Kitchen::Terraform::Command::Init.new config: hash_config
67
75
  self.logger = logger
68
- self.options = { cwd: config.fetch(:root_module_directory), timeout: config.fetch(:command_timeout) }
76
+ self.options = {
77
+ cwd: complete_config.fetch(:root_module_directory),
78
+ timeout: complete_config.fetch(:command_timeout),
79
+ }
69
80
  self.workspace_name = workspace_name
70
- self.workspace_new = ::Kitchen::Terraform::Command::WorkspaceNew.new config: hash_config
71
- self.workspace_select = ::Kitchen::Terraform::Command::WorkspaceSelect.new config: hash_config
81
+ self.workspace_new = ::Kitchen::Terraform::Command::WorkspaceNew.new config: complete_config
82
+ self.workspace_select = ::Kitchen::Terraform::Command::WorkspaceSelect.new config: complete_config
72
83
  self.verify_version = ::Kitchen::Terraform::VerifyVersion.new(
73
- command_executor: command_executor,
74
- config: config,
84
+ config: complete_config,
75
85
  logger: logger,
76
86
  version_requirement: version_requirement,
77
87
  )
@@ -81,8 +91,9 @@ module Kitchen
81
91
  private
82
92
 
83
93
  attr_accessor(
94
+ :client_version,
84
95
  :command_executor,
85
- :init,
96
+ :complete_config,
86
97
  :logger,
87
98
  :options,
88
99
  :verify_version,
@@ -94,7 +105,7 @@ module Kitchen
94
105
 
95
106
  def create_or_select_workspace
96
107
  logger.warn "Creating the #{workspace_name} Terraform workspace..."
97
- command_executor.run command: workspace_new, options: options do |standard_output:|
108
+ command_executor.run command: workspace_new, options: options do |standard_output|
98
109
  end
99
110
  logger.warn "Finished creating the #{workspace_name} Terraform workspace."
100
111
  rescue ::Kitchen::TransientFailure
@@ -103,14 +114,26 @@ module Kitchen
103
114
 
104
115
  def initialize_directory
105
116
  logger.warn "Initializing the Terraform working directory..."
106
- command_executor.run command: init, options: options do |standard_output:|
117
+ command_executor.run(
118
+ command: ::Kitchen::Terraform::Command::InitFactory.new(version: client_version)
119
+ .build(config: complete_config),
120
+ options: options,
121
+ ) do |standard_output|
107
122
  end
108
123
  logger.warn "Finished initializing the Terraform working directory."
109
124
  end
110
125
 
126
+ def read_client_version
127
+ logger.warn "Reading the Terraform client version..."
128
+ command_executor.run command: version, options: options do |standard_output|
129
+ self.client_version = ::Gem::Version.new standard_output.slice /Terraform v(\d+\.\d+\.\d+)/, 1
130
+ end
131
+ logger.warn "Finished reading the Terraform client version."
132
+ end
133
+
111
134
  def select_workspace
112
135
  logger.warn "Selecting the #{workspace_name} Terraform workspace..."
113
- command_executor.run command: workspace_select, options: options do |standard_output:|
136
+ command_executor.run command: workspace_select, options: options do |standard_output|
114
137
  end
115
138
  logger.warn "Finished selecting the #{workspace_name} Terraform workspace."
116
139
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -17,12 +17,13 @@
17
17
  require "kitchen"
18
18
  require "kitchen/terraform/command_executor"
19
19
  require "kitchen/terraform/command/destroy"
20
- require "kitchen/terraform/command/init"
20
+ require "kitchen/terraform/command/init_factory"
21
21
  require "kitchen/terraform/command/version"
22
22
  require "kitchen/terraform/command/workspace_delete"
23
23
  require "kitchen/terraform/command/workspace_new"
24
24
  require "kitchen/terraform/command/workspace_select"
25
25
  require "kitchen/terraform/verify_version"
26
+ require "rubygems"
26
27
 
27
28
  module Kitchen
28
29
  module Terraform
@@ -31,7 +32,13 @@ module Kitchen
31
32
  #
32
33
  # ===== Initializing the Terraform Working Directory
33
34
  #
34
- # {include:Kitchen::Terraform::Command::Init}
35
+ # ====== Terraform >= 0.15.0
36
+ #
37
+ # {include:Kitchen::Terraform::Command::Init::PostZeroFifteenZero}
38
+ #
39
+ # ====== Terraform < 0.15.0
40
+ #
41
+ # {include:Kitchen::Terraform::Command::Init::PreZeroFifteenZero}
35
42
  #
36
43
  # ===== Selecting or Creating the Test Terraform Workspace
37
44
  #
@@ -56,7 +63,8 @@ module Kitchen
56
63
  # @raise [Kitchen::TransientFailure] if a command fails.
57
64
  # @return [self]
58
65
  def call
59
- verify_version.call command: version, options: options
66
+ read_client_version
67
+ verify_version.call version: client_version
60
68
  execute_workflow
61
69
 
62
70
  self
@@ -70,25 +78,24 @@ module Kitchen
70
78
  # @param workspace_name [String] the name of the Terraform workspace to select or to create.
71
79
  # @return [Kitchen::Terraform::Driver::Destroy]
72
80
  def initialize(config:, logger:, version_requirement:, workspace_name:)
73
- hash_config = config.to_hash.merge upgrade_during_init: false, workspace_name: workspace_name
81
+ self.complete_config = config.to_hash.merge upgrade_during_init: false, workspace_name: workspace_name
82
+ self.client_version = ::Gem::Version.new "0.0.0"
74
83
  self.command_executor = ::Kitchen::Terraform::CommandExecutor.new(
75
- client: config.fetch(:client),
84
+ client: complete_config.fetch(:client),
76
85
  logger: logger,
77
86
  )
78
87
  self.logger = logger
79
- self.options = { cwd: config.fetch(:root_module_directory), timeout: config.fetch(:command_timeout) }
88
+ define_options
80
89
  self.workspace_name = workspace_name
81
- self.destroy = ::Kitchen::Terraform::Command::Destroy.new config: config
82
- self.init = ::Kitchen::Terraform::Command::Init.new config: hash_config
83
- self.workspace_delete_test = ::Kitchen::Terraform::Command::WorkspaceDelete.new config: hash_config
84
- self.workspace_new_test = ::Kitchen::Terraform::Command::WorkspaceNew.new config: hash_config
85
- self.workspace_select_test = ::Kitchen::Terraform::Command::WorkspaceSelect.new config: hash_config
90
+ self.destroy = ::Kitchen::Terraform::Command::Destroy.new config: complete_config
91
+ self.workspace_delete_test = ::Kitchen::Terraform::Command::WorkspaceDelete.new config: complete_config
92
+ self.workspace_new_test = ::Kitchen::Terraform::Command::WorkspaceNew.new config: complete_config
93
+ self.workspace_select_test = ::Kitchen::Terraform::Command::WorkspaceSelect.new config: complete_config
86
94
  self.workspace_select_default = ::Kitchen::Terraform::Command::WorkspaceSelect.new(
87
- config: hash_config.merge(workspace_name: "default"),
95
+ config: complete_config.merge(workspace_name: "default"),
88
96
  )
89
97
  self.verify_version = ::Kitchen::Terraform::VerifyVersion.new(
90
- command_executor: command_executor,
91
- config: config,
98
+ config: complete_config,
92
99
  logger: logger,
93
100
  version_requirement: version_requirement,
94
101
  )
@@ -98,7 +105,10 @@ module Kitchen
98
105
  private
99
106
 
100
107
  attr_accessor(
108
+ :client_version,
101
109
  :command_executor,
110
+ :complete_config,
111
+ :destroy_options,
102
112
  :destroy,
103
113
  :init,
104
114
  :logger,
@@ -114,21 +124,31 @@ module Kitchen
114
124
 
115
125
  def create_test_workspace
116
126
  logger.warn "Creating the #{workspace_name} Terraform workspace..."
117
- command_executor.run command: workspace_new_test, options: options do |standard_output:|
127
+ command_executor.run command: workspace_new_test, options: options do |standard_output|
118
128
  end
119
129
  logger.warn "Finished creating the #{workspace_name} Terraform workspace."
120
130
  end
121
131
 
132
+ def define_options
133
+ self.options = {
134
+ cwd: complete_config.fetch(:root_module_directory),
135
+ timeout: complete_config.fetch(:command_timeout),
136
+ }
137
+ self.destroy_options = options.merge(
138
+ environment: { "LC_ALL" => nil, "TF_IN_AUTOMATION" => "true", "TF_WARN_OUTPUT_ERRORS" => "true" },
139
+ )
140
+ end
141
+
122
142
  def destroy_infrastructure
123
143
  logger.warn "Destroying the Terraform-managed infrastructure..."
124
- command_executor.run command: destroy, options: options do |standard_output:|
144
+ command_executor.run command: destroy, options: destroy_options do |standard_output|
125
145
  end
126
146
  logger.warn "Finished destroying the Terraform-managed infrastructure."
127
147
  end
128
148
 
129
149
  def delete_test_workspace
130
150
  logger.warn "Deleting the #{workspace_name} Terraform workspace..."
131
- command_executor.run command: workspace_delete_test, options: options do |standard_output:|
151
+ command_executor.run command: workspace_delete_test, options: options do |standard_output|
132
152
  end
133
153
  logger.warn "Finished deleting the #{workspace_name} Terraform workspace."
134
154
  end
@@ -143,21 +163,33 @@ module Kitchen
143
163
 
144
164
  def initialize_directory
145
165
  logger.warn "Initializing the Terraform working directory..."
146
- command_executor.run command: init, options: options do |standard_output:|
166
+ command_executor.run(
167
+ command: ::Kitchen::Terraform::Command::InitFactory.new(version: client_version)
168
+ .build(config: complete_config),
169
+ options: options,
170
+ ) do |standard_output|
147
171
  end
148
172
  logger.warn "Finished initializing the Terraform working directory."
149
173
  end
150
174
 
175
+ def read_client_version
176
+ logger.warn "Reading the Terraform client version..."
177
+ command_executor.run command: version, options: options do |standard_output|
178
+ self.client_version = ::Gem::Version.new standard_output.slice /Terraform v(\d+\.\d+\.\d+)/, 1
179
+ end
180
+ logger.warn "Finished reading the Terraform client version."
181
+ end
182
+
151
183
  def select_default_workspace
152
184
  logger.warn "Selecting the default Terraform workspace..."
153
- command_executor.run command: workspace_select_default, options: options do |standard_output:|
185
+ command_executor.run command: workspace_select_default, options: options do |standard_output|
154
186
  end
155
187
  logger.warn "Finished selecting the default Terraform workspace."
156
188
  end
157
189
 
158
190
  def select_or_create_test_workspace
159
191
  logger.warn "Selecting the #{workspace_name} Terraform workspace..."
160
- command_executor.run command: workspace_select_test, options: options do |standard_output:|
192
+ command_executor.run command: workspace_select_test, options: options do |standard_output|
161
193
  end
162
194
  logger.warn "Finished selecting the #{workspace_name} Terraform workspace."
163
195
  rescue ::Kitchen::TransientFailure
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -60,7 +60,14 @@ module Kitchen
60
60
  self.host = options.fetch :host do
61
61
  ""
62
62
  end
63
+
64
+ ::Inspec::Plugin::V2::Loader.new.tap do |loader|
65
+ loader.load_all
66
+ loader.exit_on_load_error
67
+ end
68
+
63
69
  self.runner = ::Inspec::Runner.new options.merge logger: ::Inspec::Log.logger
70
+
64
71
  profile_locations.each do |profile_location|
65
72
  runner.add_target profile_location
66
73
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2016-2019 New Context, Inc.
3
+ # Copyright 2016-2021 Copado NCS LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.