Skip to content

Commit

Permalink
Select workspace before retrieving outputs (#305)
Browse files Browse the repository at this point in the history
* Select workspace before retrieving outputs

* Fix documented yield param of output methods

* Remove output from shared examples description

* Update version to 4.1.1

* Update Change Log

* Fix Change Log header size

* Update release date
  • Loading branch information
aaron-lane authored Dec 13, 2018
1 parent d009644 commit 490cdf4
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 82 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased][unreleased]

## [4.1.1] - 2018-12-13

### Fixed

- The Terraform workspace is selected before outputs are retrieved.

## [4.1.0] - 2018-12-09

## Changed
### Changed

- The bundled version of InSpec is now ~> 3.0. Despite the major
version change, it is intended to be backward compatible.
Expand Down Expand Up @@ -564,7 +570,8 @@ Gandalf the Free-As-In-Beer

- Initial release

[unreleased]: https://github.com/newcontext/kitchen-terraform/compare/v4.1.0...HEAD
[unreleased]: https://github.com/newcontext/kitchen-terraform/compare/v4.1.1...HEAD
[4.1.1]: https://github.com/newcontext/kitchen-terraform/compare/v4.1.0...v4.1.1
[4.1.0]: https://github.com/newcontext/kitchen-terraform/compare/v4.0.6...v4.1.0
[4.0.6]: https://github.com/newcontext/kitchen-terraform/compare/v4.0.5...v4.0.6
[4.0.5]: https://github.com/newcontext/kitchen-terraform/compare/v4.0.4...v4.0.5
Expand Down
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
kitchen-terraform (4.1.0)
kitchen-terraform (4.1.1)
dry-types (~> 0.9)
dry-validation (~> 0.10)
inspec (~> 3.0)
Expand All @@ -20,13 +20,13 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (8.6.5)
execjs
aws-sdk (2.11.188)
aws-sdk-resources (= 2.11.188)
aws-sdk-core (2.11.188)
aws-sdk (2.11.189)
aws-sdk-resources (= 2.11.189)
aws-sdk-core (2.11.189)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.188)
aws-sdk-core (= 2.11.188)
aws-sdk-resources (2.11.189)
aws-sdk-core (= 2.11.189)
aws-sigv4 (1.0.3)
azure_graph_rbac (0.17.0)
ms_rest_azure (~> 0.11.0)
Expand Down Expand Up @@ -264,7 +264,7 @@ GEM
mixlib-versioning
thor
mixlib-log (2.0.4)
mixlib-shellout (2.4.2)
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.2)
ms_rest (0.7.3)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -340,7 +340,7 @@ GEM
rubyntlm (0.6.2)
rubyzip (1.2.2)
sass (3.4.25)
semverse (2.0.0)
semverse (3.0.0)
servolux (0.13.0)
shellany (0.0.1)
signet (0.11.0)
Expand All @@ -357,7 +357,7 @@ GEM
temple (0.8.0)
term-ansicolor (1.7.0)
tins (~> 1.0)
test-kitchen (1.23.3)
test-kitchen (1.23.5)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
Expand All @@ -373,7 +373,7 @@ GEM
timeliness (0.3.8)
tins (1.20.2)
tomlrb (1.2.7)
train (1.5.6)
train (1.5.11)
aws-sdk (~> 2)
azure_graph_rbac (~> 0.16)
azure_mgmt_key_vault (~> 0.17)
Expand Down Expand Up @@ -455,4 +455,4 @@ RUBY VERSION
ruby 2.5.3p105

BUNDLED WITH
1.17.1
1.17.2
6 changes: 4 additions & 2 deletions lib/kitchen/driver/terraform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ def destroy(_state)
)
end

# Retrieves the Terraform state outputs.
# Retrieves the Terraform state outputs for a Kitchen instance by selecting the test workspace and fetching the
# outputs.
#
# @raise [::Kitchen::Terraform::Error] if the retrieval fails.
# @return [void]
# @yieldparam output [::String] the state output.
# @yieldparam output [::Hash] the state output.
def retrieve_outputs(&block)
run_workspace_select_instance
::Kitchen::Terraform::Command::Output.run(
options: {
cwd: config_root_module_directory, live_stream: logger, timeout: config_command_timeout,
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/terraform/command/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class << self
# command.
# @option options [::Integer] :timeout the maximum duration in seconds to run the command.
# @param options [::Hash] options which adjust the execution of the command.
# @yieldparam output [::String] the standard output of the command parsed as JSON.
# @yieldparam output [::Hash] the standard output of the command parsed as JSON.
def run(options:, &block)
run_shell_out(
options: options,
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/terraform/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def temporarily_override(version:)

# @api private
def value
self.value = ::Gem::Version.new "4.1.0" if not @value
self.value = ::Gem::Version.new "4.1.1" if not @value
@value
end

Expand Down
22 changes: 11 additions & 11 deletions ruby-2.3/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
kitchen-terraform (4.1.0)
kitchen-terraform (4.1.1)
dry-types (~> 0.9)
dry-validation (~> 0.10)
inspec (~> 3.0)
Expand All @@ -20,13 +20,13 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (8.6.5)
execjs
aws-sdk (2.11.188)
aws-sdk-resources (= 2.11.188)
aws-sdk-core (2.11.188)
aws-sdk (2.11.189)
aws-sdk-resources (= 2.11.189)
aws-sdk-core (2.11.189)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.188)
aws-sdk-core (= 2.11.188)
aws-sdk-resources (2.11.189)
aws-sdk-core (= 2.11.189)
aws-sigv4 (1.0.3)
azure_graph_rbac (0.17.0)
ms_rest_azure (~> 0.11.0)
Expand Down Expand Up @@ -264,7 +264,7 @@ GEM
mixlib-versioning
thor
mixlib-log (2.0.4)
mixlib-shellout (2.4.2)
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.2)
ms_rest (0.7.3)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -340,7 +340,7 @@ GEM
rubyntlm (0.6.2)
rubyzip (1.2.2)
sass (3.4.25)
semverse (2.0.0)
semverse (3.0.0)
servolux (0.13.0)
shellany (0.0.1)
signet (0.11.0)
Expand All @@ -357,7 +357,7 @@ GEM
temple (0.8.0)
term-ansicolor (1.7.0)
tins (~> 1.0)
test-kitchen (1.23.3)
test-kitchen (1.23.5)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
Expand All @@ -373,7 +373,7 @@ GEM
timeliness (0.3.8)
tins (1.20.2)
tomlrb (1.2.7)
train (1.5.6)
train (1.5.11)
aws-sdk (~> 2)
azure_graph_rbac (~> 0.16)
azure_mgmt_key_vault (~> 0.17)
Expand Down Expand Up @@ -455,4 +455,4 @@ RUBY VERSION
ruby 2.3.8p459

BUNDLED WITH
1.17.1
1.17.2
22 changes: 11 additions & 11 deletions ruby-2.4/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
kitchen-terraform (4.1.0)
kitchen-terraform (4.1.1)
dry-types (~> 0.9)
dry-validation (~> 0.10)
inspec (~> 3.0)
Expand All @@ -20,13 +20,13 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (8.6.5)
execjs
aws-sdk (2.11.188)
aws-sdk-resources (= 2.11.188)
aws-sdk-core (2.11.188)
aws-sdk (2.11.189)
aws-sdk-resources (= 2.11.189)
aws-sdk-core (2.11.189)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.188)
aws-sdk-core (= 2.11.188)
aws-sdk-resources (2.11.189)
aws-sdk-core (= 2.11.189)
aws-sigv4 (1.0.3)
azure_graph_rbac (0.17.0)
ms_rest_azure (~> 0.11.0)
Expand Down Expand Up @@ -265,7 +265,7 @@ GEM
mixlib-versioning
thor
mixlib-log (2.0.4)
mixlib-shellout (2.4.2)
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.2)
ms_rest (0.7.3)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -345,7 +345,7 @@ GEM
rubyntlm (0.6.2)
rubyzip (1.2.2)
sass (3.4.25)
semverse (2.0.0)
semverse (3.0.0)
servolux (0.13.0)
shellany (0.0.1)
signet (0.11.0)
Expand All @@ -362,7 +362,7 @@ GEM
temple (0.8.0)
term-ansicolor (1.7.0)
tins (~> 1.0)
test-kitchen (1.23.3)
test-kitchen (1.23.5)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
Expand All @@ -378,7 +378,7 @@ GEM
timeliness (0.3.8)
tins (1.20.2)
tomlrb (1.2.7)
train (1.5.6)
train (1.5.11)
aws-sdk (~> 2)
azure_graph_rbac (~> 0.16)
azure_mgmt_key_vault (~> 0.17)
Expand Down Expand Up @@ -463,4 +463,4 @@ RUBY VERSION
ruby 2.4.5p335

BUNDLED WITH
1.17.1
1.17.2
Loading

0 comments on commit 490cdf4

Please sign in to comment.