-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: Correctly format nested outputs #7608
Conversation
Travis says " |
034262d
to
e1ce2ab
Compare
Formating fixed now @phinze! |
I would love to see a unit test or two around this, but since it's cosmetic and I've seen it demo'd I'll allow it! 😄 👍 LGTM |
This commit pretty prints outputs which consist of nested complex structures (e.g. lists of lists, lists of maps). Fixes #7143.
e1ce2ab
to
afb56c0
Compare
@phinze I've added some tests and a new |
This commit removes the ability to index into complex output types using `terraform output a_list 1` (for example), and adds a `-json` flag to the `terraform output` command, such that the output can be piped through a post-processor such as jq or json. This removes the need to allow arbitrary traversal of nested structures. It also adds tests of human readable ("normal") output with nested lists and maps, and of the new JSON output.
afb56c0
to
b4048df
Compare
@@ -53,19 +53,19 @@ func TestOutput(t *testing.T) { | |||
func TestModuleOutput(t *testing.T) { | |||
originalState := &terraform.State{ | |||
Modules: []*terraform.ModuleState{ | |||
&terraform.ModuleState{ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
LGTM! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This commit pretty prints outputs which consist of nested complex structures (e.g. lists of lists, lists of maps).
Fixes #7143.
cc @phinze