kitchen-terraform 6.1.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kitchen-terraform might be problematic. Click here for more details.

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: 6.1.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lane
@@ -62,7 +62,7 @@ cert_chain:
62
62
  JH4yGDzVEYaZHaohSDcYuGLK6OQylPu7oM75S+TNLWseDIT8bWgQk6NelVjtQQ2Q
63
63
  XSbgfu863jyey/0qO01cUo3+iTqzl85cWg==
64
64
  -----END CERTIFICATE-----
65
- date: 2022-01-22 00:00:00.000000000 Z
65
+ date: 2023-04-09 00:00:00.000000000 Z
66
66
  dependencies:
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: guard-rspec
@@ -112,14 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '2.7'
115
+ version: '3.0'
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '2.7'
122
+ version: '3.0'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: middleman-favicon-maker
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -176,6 +176,20 @@ dependencies:
176
176
  - - "~>"
177
177
  - !ruby/object:Gem::Version
178
178
  version: '4.2'
179
+ - !ruby/object:Gem::Dependency
180
+ name: mini_racer
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "~>"
184
+ - !ruby/object:Gem::Version
185
+ version: 0.6.3
186
+ type: :development
187
+ prerelease: false
188
+ version_requirements: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: 0.6.3
179
193
  - !ruby/object:Gem::Dependency
180
194
  name: rake
181
195
  requirement: !ruby/object:Gem::Requirement
@@ -210,28 +224,28 @@ dependencies:
210
224
  requirements:
211
225
  - - "~>"
212
226
  - !ruby/object:Gem::Version
213
- version: '0.7'
227
+ version: 0.15.1
214
228
  type: :development
215
229
  prerelease: false
216
230
  version_requirements: !ruby/object:Gem::Requirement
217
231
  requirements:
218
232
  - - "~>"
219
233
  - !ruby/object:Gem::Version
220
- version: '0.7'
234
+ version: 0.15.1
221
235
  - !ruby/object:Gem::Dependency
222
236
  name: simplecov
223
237
  requirement: !ruby/object:Gem::Requirement
224
238
  requirements:
225
239
  - - "~>"
226
240
  - !ruby/object:Gem::Version
227
- version: 0.16.1
241
+ version: 0.22.0
228
242
  type: :development
229
243
  prerelease: false
230
244
  version_requirements: !ruby/object:Gem::Requirement
231
245
  requirements:
232
246
  - - "~>"
233
247
  - !ruby/object:Gem::Version
234
- version: 0.16.1
248
+ version: 0.22.0
235
249
  - !ruby/object:Gem::Dependency
236
250
  name: yard
237
251
  requirement: !ruby/object:Gem::Requirement
@@ -252,14 +266,14 @@ dependencies:
252
266
  requirements:
253
267
  - - "~>"
254
268
  - !ruby/object:Gem::Version
255
- version: 6.0.2
269
+ version: '6.1'
256
270
  type: :development
257
271
  prerelease: false
258
272
  version_requirements: !ruby/object:Gem::Requirement
259
273
  requirements:
260
274
  - - "~>"
261
275
  - !ruby/object:Gem::Version
262
- version: 6.0.2
276
+ version: '6.1'
263
277
  - !ruby/object:Gem::Dependency
264
278
  name: webrick
265
279
  requirement: !ruby/object:Gem::Requirement
@@ -278,20 +292,14 @@ dependencies:
278
292
  name: delegate
279
293
  requirement: !ruby/object:Gem::Requirement
280
294
  requirements:
281
- - - ">="
282
- - !ruby/object:Gem::Version
283
- version: 0.1.0
284
- - - "<"
295
+ - - "~>"
285
296
  - !ruby/object:Gem::Version
286
297
  version: 0.3.0
287
298
  type: :runtime
288
299
  prerelease: false
289
300
  version_requirements: !ruby/object:Gem::Requirement
290
301
  requirements:
291
- - - ">="
292
- - !ruby/object:Gem::Version
293
- version: 0.1.0
294
- - - "<"
302
+ - - "~>"
295
303
  - !ruby/object:Gem::Version
296
304
  version: 0.3.0
297
305
  - !ruby/object:Gem::Dependency
@@ -309,57 +317,25 @@ dependencies:
309
317
  - !ruby/object:Gem::Version
310
318
  version: '1.6'
311
319
  - !ruby/object:Gem::Dependency
312
- name: mixlib-shellout
320
+ name: inspec
313
321
  requirement: !ruby/object:Gem::Requirement
314
322
  requirements:
315
323
  - - "~>"
316
324
  - !ruby/object:Gem::Version
317
- version: '3.0'
318
- type: :runtime
319
- prerelease: false
320
- version_requirements: !ruby/object:Gem::Requirement
321
- requirements:
322
- - - "~>"
323
- - !ruby/object:Gem::Version
324
- version: '3.0'
325
- - !ruby/object:Gem::Dependency
326
- name: inspec
327
- requirement: !ruby/object:Gem::Requirement
328
- requirements:
325
+ version: '5.21'
329
326
  - - ">="
330
327
  - !ruby/object:Gem::Version
331
- version: '3'
332
- - - "!="
333
- - !ruby/object:Gem::Version
334
- version: 4.24.26
335
- - - "!="
336
- - !ruby/object:Gem::Version
337
- version: 4.24.28
338
- - - "!="
339
- - !ruby/object:Gem::Version
340
- version: 4.24.32
341
- - - "<"
342
- - !ruby/object:Gem::Version
343
- version: '5'
328
+ version: 5.21.29
344
329
  type: :runtime
345
330
  prerelease: false
346
331
  version_requirements: !ruby/object:Gem::Requirement
347
332
  requirements:
348
- - - ">="
349
- - !ruby/object:Gem::Version
350
- version: '3'
351
- - - "!="
352
- - !ruby/object:Gem::Version
353
- version: 4.24.26
354
- - - "!="
355
- - !ruby/object:Gem::Version
356
- version: 4.24.28
357
- - - "!="
333
+ - - "~>"
358
334
  - !ruby/object:Gem::Version
359
- version: 4.24.32
360
- - - "<"
335
+ version: '5.21'
336
+ - - ">="
361
337
  - !ruby/object:Gem::Version
362
- version: '5'
338
+ version: 5.21.29
363
339
  - !ruby/object:Gem::Dependency
364
340
  name: json
365
341
  requirement: !ruby/object:Gem::Requirement
@@ -438,7 +414,6 @@ files:
438
414
  - lib/kitchen/terraform/command/workspace_delete.rb
439
415
  - lib/kitchen/terraform/command/workspace_new.rb
440
416
  - lib/kitchen/terraform/command/workspace_select.rb
441
- - lib/kitchen/terraform/command_executor.rb
442
417
  - lib/kitchen/terraform/command_flag.rb
443
418
  - lib/kitchen/terraform/command_flag/backend_config.rb
444
419
  - lib/kitchen/terraform/command_flag/color.rb
@@ -498,7 +473,6 @@ files:
498
473
  - lib/kitchen/terraform/raise.rb
499
474
  - lib/kitchen/terraform/raise/action_failed.rb
500
475
  - lib/kitchen/terraform/raise/client_error.rb
501
- - lib/kitchen/terraform/shell_out.rb
502
476
  - lib/kitchen/terraform/system.rb
503
477
  - lib/kitchen/terraform/system_attrs_inputs_resolver.rb
504
478
  - lib/kitchen/terraform/system_attrs_outputs_resolver.rb
@@ -509,8 +483,11 @@ files:
509
483
  - lib/kitchen/terraform/systems_verifier/fail_fast.rb
510
484
  - lib/kitchen/terraform/systems_verifier/fail_slow.rb
511
485
  - lib/kitchen/terraform/systems_verifier_factory.rb
486
+ - lib/kitchen/terraform/transport.rb
487
+ - lib/kitchen/terraform/transport/connection.rb
512
488
  - lib/kitchen/terraform/unsupported_client_version_error.rb
513
489
  - lib/kitchen/terraform/variables_manager.rb
490
+ - lib/kitchen/terraform/verifier.rb
514
491
  - lib/kitchen/terraform/verify_version.rb
515
492
  - lib/kitchen/terraform/verify_version_rescue_strategy.rb
516
493
  - lib/kitchen/terraform/verify_version_rescue_strategy/permissive.rb
@@ -522,6 +499,7 @@ files:
522
499
  - lib/kitchen/terraform/version_verifier_strategy/supported.rb
523
500
  - lib/kitchen/terraform/version_verifier_strategy/unsupported.rb
524
501
  - lib/kitchen/terraform/version_verifier_strategy_factory.rb
502
+ - lib/kitchen/transport/terraform.rb
525
503
  - lib/kitchen/verifier/terraform.rb
526
504
  homepage: https://newcontext-oss.github.io/kitchen-terraform/
527
505
  licenses:
@@ -535,7 +513,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
535
513
  requirements:
536
514
  - - ">="
537
515
  - !ruby/object:Gem::Version
538
- version: '2.6'
516
+ version: '3.0'
539
517
  - - "<"
540
518
  - !ruby/object:Gem::Version
541
519
  version: '4.0'
@@ -546,7 +524,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
546
524
  version: '0'
547
525
  requirements:
548
526
  - Terraform >= v0.11.4, < v2.0.0
549
- rubygems_version: 3.0.3.1
527
+ rubygems_version: 3.4.10
550
528
  signing_key:
551
529
  specification_version: 4
552
530
  summary: Test Kitchen plugins for testing Terraform configuration
metadata.gz.sig CHANGED
Binary file
@@ -1,58 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016-2021 Copado NCS LLC
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/shell_out"
19
-
20
- module Kitchen
21
- module Terraform
22
- # CommandExecutor is the class of objects which execute Terraform CLI commands.
23
- class CommandExecutor
24
- # #initialize prepares a new instance of the class.
25
- #
26
- # @param client [String] the pathname of the Terraform client.
27
- # @param logger [Kitchen::Logger] a logger for logging messages.
28
- # @return [Kitchen::Terraform::CommandExecutor]
29
- def initialize(client:, logger:)
30
- self.client = client
31
- self.logger = logger
32
- end
33
-
34
- # #run executes a client command.
35
- #
36
- # @param command [String] the command to run.
37
- # @param options [Hash] options which adjust the execution of the command.
38
- # @option options [Integer] :timeout the maximum duration in seconds to run the command.
39
- # @option options [String] :cwd the directory in which to run the command.
40
- # @yieldparam standard_output [String] the standard output of the command.
41
- # @raise [Kitchen::TransientFailure] if running the command results in failure.
42
- # @return [self]
43
- def run(command:, options:, &block)
44
- ::Kitchen::Terraform::ShellOut.new(
45
- command: "#{client} #{command}",
46
- logger: logger,
47
- options: options,
48
- ).run(&block)
49
-
50
- self
51
- end
52
-
53
- private
54
-
55
- attr_accessor :client, :logger
56
- end
57
- end
58
- end
@@ -1,114 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2016-2021 Copado NCS LLC
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 "etc"
18
- require "kitchen"
19
- require "mixlib/shellout"
20
-
21
- module Kitchen
22
- module Terraform
23
- # Terraform commands are run by shelling out and using the
24
- # {https://www.terraform.io/docs/commands/index.html command-line interface}. The shell out environment includes the
25
- # TF_IN_AUTOMATION environment variable as specified by the
26
- # {https://www.terraform.io/guides/running-terraform-in-automation.html#controlling-terraform-output-in-automation Running Terraform in Automation guide}.
27
- class ShellOut
28
- # #initialize prepares a new instance of the class.
29
- #
30
- # @param command [String] the command to run.
31
- # @param logger [Kitchen::Logger] a logger for logging messages.
32
- # @param options [Hash] options which adjust the execution of the command.
33
- # @return [Kitchen::Terraform::CommandExecutor]
34
- def initialize(command:, logger:, options:)
35
- self.command = command
36
- self.logger = logger
37
- self.shell_out = ::Mixlib::ShellOut.new(
38
- command,
39
- {
40
- environment: { "LC_ALL" => nil, "TF_IN_AUTOMATION" => "true" },
41
- live_stream: logger,
42
- }.merge(options)
43
- )
44
- end
45
-
46
- # #run executes a command.
47
- #
48
- # @yieldparam standard_output [String] the standard output of the command.
49
- # @raise [Kitchen::TransientFailure] if running the command results in failure.
50
- # @return [self]
51
- def run
52
- execute_workflow
53
-
54
- yield shell_out.stdout
55
-
56
- self
57
- end
58
-
59
- private
60
-
61
- attr_accessor :command, :logger, :shell_out
62
-
63
- def error_access_message
64
- "Running the command `#{command}` failed due to unauthorized access to the Terraform client. Authorize the " \
65
- "#{::Etc.getlogin} user to execute the client to avoid this error."
66
- end
67
-
68
- def error_no_entry_message
69
- "Running the command `#{command}` failed due to a nonexistent Terraform client. Set `driver.client` to the " \
70
- "pathname of a client to avoid this error."
71
- end
72
-
73
- def error_non_zero_message
74
- "Running the command `#{command}` failed due to a non-zero exit code of #{shell_out.exitstatus}."
75
- end
76
-
77
- def error_timeout_message
78
- "Running the command `#{command}` failed due to an excessive execution time. Increase " \
79
- "`driver.command_timeout` to avoid this error."
80
- end
81
-
82
- def execute_workflow
83
- logger.debug run_start_message
84
- run_command
85
- logger.debug run_finish_message
86
- verify_exit_code
87
- end
88
-
89
- def run_command
90
- shell_out.run_command
91
- rescue ::Errno::EACCES
92
- raise ::Kitchen::TransientFailure, error_access_message
93
- rescue ::Errno::ENOENT
94
- raise ::Kitchen::TransientFailure, error_no_entry_message
95
- rescue ::Mixlib::ShellOut::CommandTimeout
96
- raise ::Kitchen::TransientFailure, error_timeout_message
97
- end
98
-
99
- def run_finish_message
100
- "Finished running command `#{command}` in #{shell_out.execution_time} seconds."
101
- end
102
-
103
- def run_start_message
104
- "Running command `#{command}` in directory #{shell_out.cwd} with a timeout of #{shell_out.timeout} seconds..."
105
- end
106
-
107
- def verify_exit_code
108
- shell_out.error!
109
- rescue ::Mixlib::ShellOut::ShellCommandFailed
110
- raise ::Kitchen::TransientFailure, error_non_zero_message
111
- end
112
- end
113
- end
114
- end