command/apply: Xnew-apply

This commit is contained in:
Mitchell Hashimoto 2016-10-15 15:19:43 -07:00
parent ec15783f24
commit e8516f259d
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 20 additions and 0 deletions

View File

@ -95,6 +95,26 @@ func (c *ApplyCommand) Run(args []string) int {
}
}
// Check for the new apply
if terraform.X_newApply {
desc := "Experimental new apply 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-apply",
Query: "Experimental feature enabled: new apply 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,