kitchen-terraform 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e4f5a91dd079948f39c823124a9abaa9373c1d75f820ab1361e35fdb2ad9a9a
4
- data.tar.gz: c3b49fd224514f162064c83f3efa27eab7682822f667dc6fe7f79968b9e1e2e6
3
+ metadata.gz: 5dadb3ef6bcfc581ca13d112850bee34e8e8ead663fdcd6ce8e84128c75dfe04
4
+ data.tar.gz: c3e0c635603f71e2db719186632c2d419be6a3b804021f2e7734827654d3ceaf
5
5
  SHA512:
6
- metadata.gz: 4a0e0ddc1f49f69dbf5718892b6eeb665860a9381a0854862a9cd65a8ddccf0de4f30f602861a8dd9a909f6f6617d6569e7fa3d8a65864b1c9e65f250414bdd2
7
- data.tar.gz: ff50fc286e891f70a7fdca14a826a2be0dc0638c64a3b00f5f69af632a10d8d0bad4053d7524e073f969ba44e800d4da5f61639723efdb3879c94a0e3f3cad3f
6
+ metadata.gz: f5992349fc8f42707f084531a2ad961c135c59c9769947a4ade17074b86059ff5f941f7a38185512cf63080bdafe700eccac3f010946cc22d0b6aa62cd6f0010
7
+ data.tar.gz: b4b38453c237aed8817b9577f123c7d4050b21ccf7da3bf3ec12b49931143994078879868f0c7f40a76b63652b55db19af2218e8a582fbecbde9ed810c12ec75
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -21,6 +21,7 @@ require "kitchen/terraform/command/output"
21
21
  require "kitchen/terraform/config_attribute/backend_configurations"
22
22
  require "kitchen/terraform/config_attribute/color"
23
23
  require "kitchen/terraform/config_attribute/command_timeout"
24
+ require "kitchen/terraform/config_attribute/lock"
24
25
  require "kitchen/terraform/config_attribute/lock_timeout"
25
26
  require "kitchen/terraform/config_attribute/parallelism"
26
27
  require "kitchen/terraform/config_attribute/plugin_directory"
@@ -46,7 +47,7 @@ require "kitchen/terraform/shell_out"
46
47
  #
47
48
  # terraform init \
48
49
  # -input=false \
49
- # -lock=true \
50
+ # -lock=<lock> \
50
51
  # -lock-timeout=<lock_timeout>s \
51
52
  # [-no-color] \
52
53
  # -upgrade \
@@ -71,7 +72,7 @@ require "kitchen/terraform/shell_out"
71
72
  #
72
73
  # terraform init \
73
74
  # -input=false \
74
- # -lock=true \
75
+ # -lock=<lock> \
75
76
  # -lock-timeout=<lock_timeout>s \
76
77
  # [-no-color] \
77
78
  # -force-copy \
@@ -91,7 +92,7 @@ require "kitchen/terraform/shell_out"
91
92
  #
92
93
  # terraform destroy \
93
94
  # -force \
94
- # -lock=true \
95
+ # -lock=<lock> \
95
96
  # -lock-timeout=<lock_timeout>s \
96
97
  # -input=false \
97
98
  # [-no-color] \
@@ -135,9 +136,9 @@ require "kitchen/terraform/shell_out"
135
136
  #
136
137
  # {include:Kitchen::Terraform::ConfigAttribute::CommandTimeout}
137
138
  #
138
- # ==== root_module_directory
139
+ # ==== lock
139
140
  #
140
- # {include:Kitchen::Terraform::ConfigAttribute::RootModuleDirectory}
141
+ # {include:Kitchen::Terraform::ConfigAttribute::Lock}
141
142
  #
142
143
  # ==== lock_timeout
143
144
  #
@@ -151,6 +152,10 @@ require "kitchen/terraform/shell_out"
151
152
  #
152
153
  # {include:Kitchen::Terraform::ConfigAttribute::PluginDirectory}
153
154
  #
155
+ # ==== root_module_directory
156
+ #
157
+ # {include:Kitchen::Terraform::ConfigAttribute::RootModuleDirectory}
158
+ #
154
159
  # ==== variable_files
155
160
  #
156
161
  # {include:Kitchen::Terraform::ConfigAttribute::VariableFiles}
@@ -179,6 +184,8 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
179
184
 
180
185
  include ::Kitchen::Terraform::ConfigAttribute::CommandTimeout
181
186
 
187
+ include ::Kitchen::Terraform::ConfigAttribute::Lock
188
+
182
189
  include ::Kitchen::Terraform::ConfigAttribute::LockTimeout
183
190
 
184
191
  include ::Kitchen::Terraform::ConfigAttribute::Parallelism
@@ -280,7 +287,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
280
287
  .run(
281
288
  command:
282
289
  "apply " \
283
- "-lock=true " \
290
+ "#{config_lock_flag} " \
284
291
  "#{config_lock_timeout_flag} " \
285
292
  "-input=false " \
286
293
  "-auto-approve=true " \
@@ -328,7 +335,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
328
335
  command:
329
336
  "init " \
330
337
  "-input=false " \
331
- "-lock=true " \
338
+ "#{config_lock_flag} " \
332
339
  "#{config_lock_timeout_flag} " \
333
340
  "#{config_color_flag} " \
334
341
  "-upgrade " \
@@ -352,7 +359,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
352
359
  command:
353
360
  "destroy " \
354
361
  "-force " \
355
- "-lock=true " \
362
+ "#{config_lock_flag} " \
356
363
  "#{config_lock_timeout_flag} " \
357
364
  "-input=false " \
358
365
  "#{config_color_flag} " \
@@ -373,7 +380,7 @@ class ::Kitchen::Driver::Terraform < ::Kitchen::Driver::Base
373
380
  command:
374
381
  "init " \
375
382
  "-input=false " \
376
- "-lock=true " \
383
+ "#{config_lock_flag} " \
377
384
  "#{config_lock_timeout_flag} " \
378
385
  "#{config_color_flag} " \
379
386
  "-force-copy " \
@@ -49,7 +49,7 @@ require "kitchen/terraform/error"
49
49
  # ===== Applying the Terraform State Changes
50
50
  #
51
51
  # terraform apply\
52
- # -lock=true \
52
+ # -lock=<lock> \
53
53
  # -lock-timeout=<lock_timeout>s \
54
54
  # -input=false \
55
55
  # -auto-approve=true \
@@ -0,0 +1,61 @@
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_attribute_cacher"
20
+ require "kitchen/terraform/config_attribute_definer"
21
+ require "kitchen/terraform/config_schemas/boolean"
22
+
23
+ # This attribute toggles {https://www.terraform.io/docs/state/locking.html locking of the Terraform state file}.
24
+ #
25
+ # Type:: {http://www.yaml.org/spec/1.2/spec.html#id2803629 Boolean}
26
+ # Required:: False
27
+ # Default:: +true+
28
+ # Example:: <code>lock: false</code>
29
+ #
30
+ # @abstract It must be included by plugin class in order to be used.
31
+ module ::Kitchen::Terraform::ConfigAttribute::Lock
32
+ # A callback to define the configuration attribute which is invoked when this module is included in a plugin class.
33
+ #
34
+ # @param plugin_class [::Kitchen::Configurable] A plugin class.
35
+ # @return [void]
36
+ def self.included(plugin_class)
37
+ ::Kitchen::Terraform::ConfigAttributeDefiner
38
+ .new(
39
+ attribute: self,
40
+ schema: ::Kitchen::Terraform::ConfigSchemas::Boolean
41
+ )
42
+ .define plugin_class: plugin_class
43
+ end
44
+
45
+ # @return [::Symbol] the symbol corresponding to the attribute.
46
+ def self.to_sym
47
+ :lock
48
+ end
49
+
50
+ extend ::Kitchen::Terraform::ConfigAttributeCacher
51
+
52
+ # @return [true]
53
+ def config_lock_default_value
54
+ true
55
+ end
56
+
57
+ # @return [::String] the toggle converted to a flag.
58
+ def config_lock_flag
59
+ "-lock=#{config_lock}"
60
+ end
61
+ end
@@ -17,4 +17,4 @@
17
17
  require "kitchen/terraform"
18
18
 
19
19
  # The version of the kitchen-terraform gem.
20
- ::Kitchen::Terraform::VERSION = "3.2.0".freeze
20
+ ::Kitchen::Terraform::VERSION = "3.3.0".freeze
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: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lane
@@ -55,7 +55,7 @@ cert_chain:
55
55
  XjOfZudLs1zJ8ZNOuwj6KkGJ9J3XHd9hM95MtBEWlxAfYdCuW1+v7zCTfbieBEba
56
56
  UIyyldg4TuVcuRs8uKJyempT0hqx2DniseBWw3nvtgom3A==
57
57
  -----END CERTIFICATE-----
58
- date: 2018-03-21 00:00:00.000000000 Z
58
+ date: 2018-03-22 00:00:00.000000000 Z
59
59
  dependencies:
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: bundler-audit
@@ -429,6 +429,7 @@ files:
429
429
  - lib/kitchen/terraform/config_attribute/color.rb
430
430
  - lib/kitchen/terraform/config_attribute/command_timeout.rb
431
431
  - lib/kitchen/terraform/config_attribute/groups.rb
432
+ - lib/kitchen/terraform/config_attribute/lock.rb
432
433
  - lib/kitchen/terraform/config_attribute/lock_timeout.rb
433
434
  - lib/kitchen/terraform/config_attribute/parallelism.rb
434
435
  - lib/kitchen/terraform/config_attribute/plugin_directory.rb
metadata.gz.sig CHANGED
Binary file