command/apply: -Xnew-destroy
This commit is contained in:
parent
5a8ec482a2
commit
1a418c1452
|
@ -115,6 +115,26 @@ func (c *ApplyCommand) Run(args []string) int {
|
|||
}
|
||||
}
|
||||
|
||||
// Check for the new destroy
|
||||
if terraform.X_newDestroy {
|
||||
desc := "Experimental new destroy graph has been enabled. This may still\n" +
|
||||
"have bugs, and should be used with care. If you'd like to continue,\n" +
|
||||
"you must enter exactly 'yes' as a response."
|
||||
v, err := c.UIInput().Input(&terraform.InputOpts{
|
||||
Id: "Xnew-destroy",
|
||||
Query: "Experimental feature enabled: new destroy graph. Continue?",
|
||||
Description: desc,
|
||||
})
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error asking for confirmation: %s", err))
|
||||
return 1
|
||||
}
|
||||
if v != "yes" {
|
||||
c.Ui.Output("Apply cancelled.")
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
// Build the context based on the arguments given
|
||||
ctx, planned, err := c.Context(contextOpts{
|
||||
Destroy: c.Destroy,
|
||||
|
|
|
@ -337,6 +337,7 @@ func (m *Meta) flagSet(n string) *flag.FlagSet {
|
|||
|
||||
// Experimental features
|
||||
f.BoolVar(&terraform.X_newApply, "Xnew-apply", false, "experiment: new apply")
|
||||
f.BoolVar(&terraform.X_newDestroy, "Xnew-destroy", false, "experiment: new destroy")
|
||||
|
||||
// Create an io.Writer that writes to our Ui properly for errors.
|
||||
// This is kind of a hack, but it does the job. Basically: create
|
||||
|
|
Loading…
Reference in New Issue