terraspace 2.1.5 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 786aaa7595dab99d8ffb03635a1bbdac8ac8f05f9bf8d54ac233df032e2656e8
4
- data.tar.gz: bdc2ac26c76de54170a7627b9437e4a08535de61a81d868e0b29c8606db80c7a
3
+ metadata.gz: 449ffd121de77d38b64d44f30a56639714f27fd3b0a7c50b00c4f897157c9ef5
4
+ data.tar.gz: 815fddcc7cfa9b01e335de6d160d941c6d1b4a025b6bab902a1aa4552752b9df
5
5
  SHA512:
6
- metadata.gz: 2f57094e1b29721f0948e1e94ac264cafa2b57dde3c55e4d5c5807cfff5c4ebf5ef044f8ca8a2b1132be13294c03f5a350ccc70db6fc4642226445fc4346c9c1
7
- data.tar.gz: 8b700ec6b2543b0388d6be8989cee3bdeb14e814b927c93b6aa6855a00e31cf6117587d8300cf875b44771bd24e4d5a6aa0d260456f453a8ee73625cefa32a91
6
+ metadata.gz: dc167ec202e62e70dd129d4ac85dc30a4179576315b880303205569434d7e31a35e5d331df64b2e478efb0459fcb902764ec6c860af650ea7ec8dcbc7caefe47
7
+ data.tar.gz: da40e6f0760f535a0e604aad16b31ddd708090521c070469739a0e13d0129542676951892e1859fd779b4bcbbda15a168e260cd43dc4e41964bbc0a0a28ffb48
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [2.1.6] - 2022-08-19
7
+ - [#258](https://github.com/boltops-tools/terraspace/pull/258) Fix terraform apply/destroy missing some passthrough options
8
+
6
9
  ## [2.1.5] - 2022-07-21
7
10
  - [#255](https://github.com/boltops-tools/terraspace/pull/255) dont compute git info when not cloud not enabled and warn message improvement
8
11
  - pin terraspace to major version in initially generated Gemfile
@@ -60,6 +60,17 @@ module Terraspace::Terraform::Args
60
60
  result
61
61
  end
62
62
 
63
+ def terraform_arg_types
64
+ arg_types = terraform_arg_types_for_command(@name)
65
+ # "terraspace apply/destroy" support the same options as "plan", but they don't document
66
+ # them directly in their "-help" option, so we need to add them.
67
+ if ["apply", "destroy"].include? @name
68
+ arg_types.merge! terraform_arg_types_for_command("plan")
69
+ end
70
+
71
+ arg_types
72
+ end
73
+
63
74
  # Parses terraform COMMAND -help output for arg types.
64
75
  # Return Example:
65
76
  #
@@ -69,8 +80,8 @@ module Terraspace::Terraform::Args
69
80
  # var: :hash,
70
81
  # }
71
82
  #
72
- def terraform_arg_types
73
- out = terraform_help(@name)
83
+ def terraform_arg_types_for_command(name)
84
+ out = terraform_help(name)
74
85
  lines = out.split("\n")
75
86
  lines.select! do |line|
76
87
  line =~ /^ -/
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "2.1.5"
2
+ VERSION = "2.1.6"
3
3
  end
@@ -51,6 +51,19 @@ describe Terraspace::Terraform::Args::Pass do
51
51
  end
52
52
  end
53
53
 
54
+ context "indirectly documented args" do
55
+ # "terraform apply -help" doesn't document "-target" directly, but refers to
56
+ # "terraform plan -help" documentation.
57
+ context "-target=resource" do
58
+ let(:args) { ["-target=foo.bar"] }
59
+ let(:name) { "apply" }
60
+ it "pass through args" do
61
+ args = pass.args
62
+ expect(args).to eq ["-target=foo.bar"]
63
+ end
64
+ end
65
+ end
66
+
54
67
  context "hash arg" do
55
68
  context "-var 'foo=bar'" do
56
69
  let(:args) { ["-var 'foo=bar'"] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-21 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport