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: Use -state-out option when applying from a plan #7443

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Jun 30, 2016

When working from an existing plan, we weren't setting the PathOut field
for a LocalState. This required adding an outPath argument to the
StateFromPlan function to avoid having to introspect the returned
state.State interface to find the appropriate field.

Fixes #7264

@jbardin
Copy link
Member Author

jbardin commented Jul 1, 2016

Added a test.

This runs a plan from inside an Apply test to generate a new plan file. We could also just put the plan file in a test fixture, but I thought this way was less likely to get stale.


tmpDir := testTempDir(t)
defer os.RemoveAll(tmpDir)
fmt.Println("tmpDir:", tmpDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

stray print here

@phinze
Copy link
Contributor

phinze commented Jul 1, 2016

Found a stray print inline, other than that this LGTM!

When working from an existing plan, we weren't setting the PathOut field
for a LocalState. This required adding an outPath argument to the
StateFromPlan function to avoid having to introspect the returned
state.State interface to find the appropriate field.

To test we run a plan first and provide the new plan to apply with
`-state-out` set.
@jbardin jbardin merged commit b0b2923 into master Jul 1, 2016
@jbardin jbardin deleted the jbardin/GH-7264 branch July 1, 2016 18:19
@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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flag -state-out is ignored on terraform apply when plan file is used
2 participants