-
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
add -force-copy
option to init command
#12939
Conversation
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.
One typo.
This works great for now. In the future we should consider exposing setting values for the "id" set on InputOpts. It is why they are there we just don't have a way to short-circuit them right now in non-test code. That would let us more easily do force flags without having to special case branches.
command/init.go
Outdated
@@ -225,6 +228,10 @@ Options: | |||
|
|||
-no-color If specified, output won't contain any color. | |||
|
|||
-force-copy Suppress prompts about copying state data. This is | |||
equivalent to providing a "yes" to all confirmation | |||
prompts. |
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.
I think this is a stray tab char.
The `-force-copy` option will suppress confirmation for copying state data. Modify some tests to use the option, making sure to leave coverage of the Input code path.
eda4e29
to
54e536c
Compare
@mitchellh, thanks for the confirmation, I wasn't sure if that was the plan for the input ID and was going to look into it later ;) |
The documentation for init command is missing this flag. |
Is there any way to force a no...? |
@s-pk If you use Edit: Here's the documenation for that. You can also set it with an environment variable. |
@nbering but I don't want to error out, I don't want to copy. |
@tonglil I think the context of my comment may have been lost. I suspect the person I was replying to deleted their account, because their comment is missing and that name's profile comes up with a 404. Despite that, I think what you're looking for is the https://www.terraform.io/docs/commands/init.html#backend-initialization |
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. |
The
-force-copy
option will suppress confirmation for copying statedata.
Modify some tests to use the option, making sure to leave coverage of
the Input code path.
fixes #12921