Skip to content
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

Merged
merged 2 commits into from
Jul 13, 2016
Merged

Conversation

jen20
Copy link
Contributor

@jen20 jen20 commented Jul 12, 2016

This commit pretty prints outputs which consist of nested complex structures (e.g. lists of lists, lists of maps).

Fixes #7143.

cc @phinze

@phinze
Copy link
Contributor

phinze commented Jul 12, 2016

Travis says "fmt you!" 😛

@jen20
Copy link
Contributor Author

jen20 commented Jul 12, 2016

Formating fixed now @phinze!

@phinze
Copy link
Contributor

phinze commented Jul 12, 2016

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.
@jen20
Copy link
Contributor Author

jen20 commented Jul 13, 2016

@phinze I've added some tests and a new -json flag to the output format - detail in the commit message.

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.
@@ -53,19 +53,19 @@ func TestOutput(t *testing.T) {
func TestModuleOutput(t *testing.T) {
originalState := &terraform.State{
Modules: []*terraform.ModuleState{
&terraform.ModuleState{
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@phinze
Copy link
Contributor

phinze commented Jul 13, 2016

LGTM!

@jen20 jen20 merged commit 9ca3f2d into master Jul 13, 2016
@jen20 jen20 deleted the nested-output-formatting branch July 13, 2016 18:14
@ghost
Copy link

ghost commented Apr 24, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to make splat reference to attribute of type map
2 participants