-Xnew-apply to enable the new apply graph
This commit is contained in:
parent
eb9ecea863
commit
ec15783f24
|
@ -10,6 +10,7 @@ install:
|
||||||
- bash scripts/gogetcookie.sh
|
- bash scripts/gogetcookie.sh
|
||||||
script:
|
script:
|
||||||
- make test vet
|
- make test vet
|
||||||
|
- make test TEST=./terraform TESTARGS=-Xnew-apply
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
|
@ -328,6 +328,9 @@ func (m *Meta) flagSet(n string) *flag.FlagSet {
|
||||||
f.Var((*FlagKVFile)(&m.autoVariables), m.autoKey, "variable file")
|
f.Var((*FlagKVFile)(&m.autoVariables), m.autoKey, "variable file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Experimental features
|
||||||
|
f.BoolVar(&terraform.X_newApply, "Xnew-apply", false, "experiment: new apply")
|
||||||
|
|
||||||
// Create an io.Writer that writes to our Ui properly for errors.
|
// 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
|
// This is kind of a hack, but it does the job. Basically: create
|
||||||
// a pipe, use a scanner to break it into lines, and output each line
|
// a pipe, use a scanner to break it into lines, and output each line
|
||||||
|
|
|
@ -17,9 +17,14 @@ import (
|
||||||
// is called on Context.
|
// is called on Context.
|
||||||
type InputMode byte
|
type InputMode byte
|
||||||
|
|
||||||
|
// Variables prefixed with X_ are experimental features. They can be enabled
|
||||||
|
// by setting them to true. This should be done before any API is called.
|
||||||
|
// These should be expected to be removed at some point in the future; each
|
||||||
|
// option should mention a schedule.
|
||||||
var (
|
var (
|
||||||
// NOTE: Internal only to toggle between the new and old apply graph
|
// X_newApply will enable the new apply graph. This will be removed
|
||||||
newApplyGraph = true
|
// and be on by default in 0.8.0.
|
||||||
|
X_newApply = false
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -363,7 +368,7 @@ func (c *Context) Apply() (*State, error) {
|
||||||
// our new graph builder.
|
// our new graph builder.
|
||||||
var graph *Graph
|
var graph *Graph
|
||||||
var err error
|
var err error
|
||||||
if c.destroy || !newApplyGraph {
|
if c.destroy || !X_newApply {
|
||||||
graph, err = c.Graph(&ContextGraphOpts{Validate: true})
|
graph, err = c.Graph(&ContextGraphOpts{Validate: true})
|
||||||
} else {
|
} else {
|
||||||
graph, err = (&ApplyGraphBuilder{
|
graph, err = (&ApplyGraphBuilder{
|
||||||
|
|
|
@ -22,8 +22,17 @@ import (
|
||||||
const fixtureDir = "./test-fixtures"
|
const fixtureDir = "./test-fixtures"
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
|
// Experimental features
|
||||||
|
xNewApply := flag.Bool("Xnew-apply", false, "Experiment: new apply graph")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
// Setup experimental features
|
||||||
|
X_newApply = *xNewApply
|
||||||
|
if X_newApply {
|
||||||
|
println("Xnew-apply enabled")
|
||||||
|
}
|
||||||
|
|
||||||
if testing.Verbose() {
|
if testing.Verbose() {
|
||||||
// if we're verbose, use the logging requested by TF_LOG
|
// if we're verbose, use the logging requested by TF_LOG
|
||||||
logging.SetOutput()
|
logging.SetOutput()
|
||||||
|
|
Loading…
Reference in New Issue