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

add ShowState, ShowPlan #54

Merged
merged 2 commits into from
Aug 20, 2020
Merged

add ShowState, ShowPlan #54

merged 2 commits into from
Aug 20, 2020

Conversation

kmoe
Copy link
Member

@kmoe kmoe commented Aug 16, 2020

terraform show -json PATH will output the state file or plan file at PATH in the corresponding tfjson format.

Since we must know ahead of time whether we're returning *tfjson.State or *tfjson.Plan, we now require the user to call either ShowState() or ShowPlan() if they are supplying a PATH.

Add end-to-end tests. Negative compatibility cases will be covered in #58.

@kmoe kmoe marked this pull request as ready for review August 20, 2020 01:03
@kmoe
Copy link
Member Author

kmoe commented Aug 20, 2020

@paultyng any idea why the test fails on Windows?

@paultyng
Copy link
Contributor

I wonder if we should just write up a runTerraformCmdJSON as we have a lot of these stdout unmarshalling patterns.

@kmoe
Copy link
Member Author

kmoe commented Aug 20, 2020

runTerraformCmdJSON() could work, but we're marshalling into different JSON types each time...

@kmoe kmoe requested a review from paultyng August 20, 2020 12:53
@paultyng
Copy link
Contributor

yeah, you would pass the pointer just like json.Unmarshal

@kmoe kmoe merged commit b2aad3b into master Aug 20, 2020
@kmoe kmoe deleted the show-plan branch August 20, 2020 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants