Fix passing non-string variables for other bundle actions #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The install action had been updated in #91 to work with complex data types by using a json parser to read and then write out variables when converting them from porter.yaml values to -var flags.
This ensures that primitive data types are printed without unexpected formatting, such as quotes around a string value, while arrays and objects are printed in json.
This patch applies the same fix to the other bundle actions: upgrade, invoke and uninstall. I've also extracted that common logic into a function with tests so that we can be sure all the actions are using it correctly.
Consolidate test bundle and example bundle
The test bundle had a lot of great edge cases and examples for how to use terraform in a bundle that would be useful to make people aware of in our example bundle. I have updated the basic-tf-example bundle with the contents of our test bundle. I also added defaults for all the parameters so that it doesn't require any additional config to run.
This is also good because our example bundle is tested in CI now.