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

Fix state mv with nested modules to work properly #8304

Merged
merged 11 commits into from
Aug 20, 2016
Merged

Conversation

mitchellh
Copy link
Contributor

@mitchellh mitchellh commented Aug 18, 2016

Fixes #8263
Fixes #7797

We were only adding the first result of searching for what to move. This works for every result type except modules since nested modules aren't nested within the ModuleState but alongside each other with longer paths. Rather than do a BIG refactor on nesting module states (which probably isn't right anyways), I modified State.Add and StateMvCommand to understand this limitation.

@mitchellh
Copy link
Contributor Author

Updated PR, also fixes #7797 now.

return result

case *terraform.ResourceState:
// If a module state then we should add the full list of modules
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad comment here I think.

@phinze
Copy link
Contributor

phinze commented Aug 20, 2016

LGTM generally! Two nits inline.

@mitchellh mitchellh merged commit f98459d into master Aug 20, 2016
@mitchellh mitchellh deleted the b-state-mv branch August 20, 2016 04:00
@ghost
Copy link

ghost commented Apr 23, 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 23, 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.

State files created with tf state mv... are invalid? State mv command is overly aggressive on name matching.
3 participants