kitchen-terraform 6.0.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.0.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: 2021-07-08 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
@@ -177,75 +177,75 @@ dependencies:
177
177
  - !ruby/object:Gem::Version
178
178
  version: '4.2'
179
179
  - !ruby/object:Gem::Dependency
180
- name: rake
180
+ name: mini_racer
181
181
  requirement: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: '13.0'
185
+ version: 0.6.3
186
186
  type: :development
187
187
  prerelease: false
188
188
  version_requirements: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - "~>"
191
191
  - !ruby/object:Gem::Version
192
- version: '13.0'
192
+ version: 0.6.3
193
193
  - !ruby/object:Gem::Dependency
194
- name: rspec
194
+ name: rake
195
195
  requirement: !ruby/object:Gem::Requirement
196
196
  requirements:
197
197
  - - "~>"
198
198
  - !ruby/object:Gem::Version
199
- version: '3.10'
199
+ version: '13.0'
200
200
  type: :development
201
201
  prerelease: false
202
202
  version_requirements: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - "~>"
205
205
  - !ruby/object:Gem::Version
206
- version: '3.10'
206
+ version: '13.0'
207
207
  - !ruby/object:Gem::Dependency
208
- name: rufo
208
+ name: rspec
209
209
  requirement: !ruby/object:Gem::Requirement
210
210
  requirements:
211
211
  - - "~>"
212
212
  - !ruby/object:Gem::Version
213
- version: '0.7'
213
+ version: '3.10'
214
214
  type: :development
215
215
  prerelease: false
216
216
  version_requirements: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - "~>"
219
219
  - !ruby/object:Gem::Version
220
- version: '0.7'
220
+ version: '3.10'
221
221
  - !ruby/object:Gem::Dependency
222
- name: simplecov
222
+ name: rufo
223
223
  requirement: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - - "~>"
226
226
  - !ruby/object:Gem::Version
227
- version: 0.16.1
227
+ version: 0.15.1
228
228
  type: :development
229
229
  prerelease: false
230
230
  version_requirements: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - "~>"
233
233
  - !ruby/object:Gem::Version
234
- version: 0.16.1
234
+ version: 0.15.1
235
235
  - !ruby/object:Gem::Dependency
236
- name: travis
236
+ name: simplecov
237
237
  requirement: !ruby/object:Gem::Requirement
238
238
  requirements:
239
239
  - - "~>"
240
240
  - !ruby/object:Gem::Version
241
- version: '1.8'
241
+ version: 0.22.0
242
242
  type: :development
243
243
  prerelease: false
244
244
  version_requirements: !ruby/object:Gem::Requirement
245
245
  requirements:
246
246
  - - "~>"
247
247
  - !ruby/object:Gem::Version
248
- version: '1.8'
248
+ version: 0.22.0
249
249
  - !ruby/object:Gem::Dependency
250
250
  name: yard
251
251
  requirement: !ruby/object:Gem::Requirement
@@ -266,14 +266,14 @@ dependencies:
266
266
  requirements:
267
267
  - - "~>"
268
268
  - !ruby/object:Gem::Version
269
- version: 6.0.2
269
+ version: '6.1'
270
270
  type: :development
271
271
  prerelease: false
272
272
  version_requirements: !ruby/object:Gem::Requirement
273
273
  requirements:
274
274
  - - "~>"
275
275
  - !ruby/object:Gem::Version
276
- version: 6.0.2
276
+ version: '6.1'
277
277
  - !ruby/object:Gem::Dependency
278
278
  name: webrick
279
279
  requirement: !ruby/object:Gem::Requirement
@@ -292,20 +292,14 @@ dependencies:
292
292
  name: delegate
293
293
  requirement: !ruby/object:Gem::Requirement
294
294
  requirements:
295
- - - ">="
296
- - !ruby/object:Gem::Version
297
- version: 0.1.0
298
- - - "<"
295
+ - - "~>"
299
296
  - !ruby/object:Gem::Version
300
297
  version: 0.3.0
301
298
  type: :runtime
302
299
  prerelease: false
303
300
  version_requirements: !ruby/object:Gem::Requirement
304
301
  requirements:
305
- - - ">="
306
- - !ruby/object:Gem::Version
307
- version: 0.1.0
308
- - - "<"
302
+ - - "~>"
309
303
  - !ruby/object:Gem::Version
310
304
  version: 0.3.0
311
305
  - !ruby/object:Gem::Dependency
@@ -323,57 +317,25 @@ dependencies:
323
317
  - !ruby/object:Gem::Version
324
318
  version: '1.6'
325
319
  - !ruby/object:Gem::Dependency
326
- name: mixlib-shellout
320
+ name: inspec
327
321
  requirement: !ruby/object:Gem::Requirement
328
322
  requirements:
329
323
  - - "~>"
330
324
  - !ruby/object:Gem::Version
331
- version: '3.0'
332
- type: :runtime
333
- prerelease: false
334
- version_requirements: !ruby/object:Gem::Requirement
335
- requirements:
336
- - - "~>"
337
- - !ruby/object:Gem::Version
338
- version: '3.0'
339
- - !ruby/object:Gem::Dependency
340
- name: inspec
341
- requirement: !ruby/object:Gem::Requirement
342
- requirements:
325
+ version: '5.21'
343
326
  - - ">="
344
327
  - !ruby/object:Gem::Version
345
- version: '3'
346
- - - "!="
347
- - !ruby/object:Gem::Version
348
- version: 4.24.26
349
- - - "!="
350
- - !ruby/object:Gem::Version
351
- version: 4.24.28
352
- - - "!="
353
- - !ruby/object:Gem::Version
354
- version: 4.24.32
355
- - - "<"
356
- - !ruby/object:Gem::Version
357
- version: '5'
328
+ version: 5.21.29
358
329
  type: :runtime
359
330
  prerelease: false
360
331
  version_requirements: !ruby/object:Gem::Requirement
361
332
  requirements:
362
- - - ">="
363
- - !ruby/object:Gem::Version
364
- version: '3'
365
- - - "!="
366
- - !ruby/object:Gem::Version
367
- version: 4.24.26
368
- - - "!="
369
- - !ruby/object:Gem::Version
370
- version: 4.24.28
371
- - - "!="
333
+ - - "~>"
372
334
  - !ruby/object:Gem::Version
373
- version: 4.24.32
374
- - - "<"
335
+ version: '5.21'
336
+ - - ">="
375
337
  - !ruby/object:Gem::Version
376
- version: '5'
338
+ version: 5.21.29
377
339
  - !ruby/object:Gem::Dependency
378
340
  name: json
379
341
  requirement: !ruby/object:Gem::Requirement
@@ -414,14 +376,14 @@ dependencies:
414
376
  requirements:
415
377
  - - "~>"
416
378
  - !ruby/object:Gem::Version
417
- version: 0.4.0
379
+ version: 0.5.0
418
380
  type: :runtime
419
381
  prerelease: false
420
382
  version_requirements: !ruby/object:Gem::Requirement
421
383
  requirements:
422
384
  - - "~>"
423
385
  - !ruby/object:Gem::Version
424
- version: 0.4.0
386
+ version: 0.5.0
425
387
  description: kitchen-terraform is a set of Test Kitchen plugins for testing Terraform
426
388
  configuration
427
389
  email: kitchen-terraform@newcontext.com
@@ -452,7 +414,6 @@ files:
452
414
  - lib/kitchen/terraform/command/workspace_delete.rb
453
415
  - lib/kitchen/terraform/command/workspace_new.rb
454
416
  - lib/kitchen/terraform/command/workspace_select.rb
455
- - lib/kitchen/terraform/command_executor.rb
456
417
  - lib/kitchen/terraform/command_flag.rb
457
418
  - lib/kitchen/terraform/command_flag/backend_config.rb
458
419
  - lib/kitchen/terraform/command_flag/color.rb
@@ -512,7 +473,6 @@ files:
512
473
  - lib/kitchen/terraform/raise.rb
513
474
  - lib/kitchen/terraform/raise/action_failed.rb
514
475
  - lib/kitchen/terraform/raise/client_error.rb
515
- - lib/kitchen/terraform/shell_out.rb
516
476
  - lib/kitchen/terraform/system.rb
517
477
  - lib/kitchen/terraform/system_attrs_inputs_resolver.rb
518
478
  - lib/kitchen/terraform/system_attrs_outputs_resolver.rb
@@ -523,8 +483,11 @@ files:
523
483
  - lib/kitchen/terraform/systems_verifier/fail_fast.rb
524
484
  - lib/kitchen/terraform/systems_verifier/fail_slow.rb
525
485
  - lib/kitchen/terraform/systems_verifier_factory.rb
486
+ - lib/kitchen/terraform/transport.rb
487
+ - lib/kitchen/terraform/transport/connection.rb
526
488
  - lib/kitchen/terraform/unsupported_client_version_error.rb
527
489
  - lib/kitchen/terraform/variables_manager.rb
490
+ - lib/kitchen/terraform/verifier.rb
528
491
  - lib/kitchen/terraform/verify_version.rb
529
492
  - lib/kitchen/terraform/verify_version_rescue_strategy.rb
530
493
  - lib/kitchen/terraform/verify_version_rescue_strategy/permissive.rb
@@ -536,6 +499,7 @@ files:
536
499
  - lib/kitchen/terraform/version_verifier_strategy/supported.rb
537
500
  - lib/kitchen/terraform/version_verifier_strategy/unsupported.rb
538
501
  - lib/kitchen/terraform/version_verifier_strategy_factory.rb
502
+ - lib/kitchen/transport/terraform.rb
539
503
  - lib/kitchen/verifier/terraform.rb
540
504
  homepage: https://newcontext-oss.github.io/kitchen-terraform/
541
505
  licenses:
@@ -549,7 +513,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
549
513
  requirements:
550
514
  - - ">="
551
515
  - !ruby/object:Gem::Version
552
- version: '2.6'
516
+ version: '3.0'
553
517
  - - "<"
554
518
  - !ruby/object:Gem::Version
555
519
  version: '4.0'
@@ -559,8 +523,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
559
523
  - !ruby/object:Gem::Version
560
524
  version: '0'
561
525
  requirements:
562
- - Terraform >= v0.11.4, < v1.1.0
563
- rubygems_version: 3.0.3.1
526
+ - Terraform >= v0.11.4, < v2.0.0
527
+ rubygems_version: 3.4.10
564
528
  signing_key:
565
529
  specification_version: 4
566
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