Merge pull request #11733 from hashicorp/b-disable-shadow

terraform: default shadow to false
This commit is contained in:
Mitchell Hashimoto 2017-02-07 12:57:46 -08:00 committed by GitHub
commit e7aa1fd48d
3 changed files with 12 additions and 7 deletions

View File

@ -52,7 +52,7 @@ import (
var (
// Shadow graph. This is already on by default. Disabling it will be
// allowed for awhile in order for it to not block operations.
X_shadow = newBasicID("shadow", "SHADOW", true)
X_shadow = newBasicID("shadow", "SHADOW", false)
)
// Global variables this package uses because we are a package

View File

@ -748,21 +748,22 @@ func (c *Context) walk(
shadow = nil
}
// Just log this so we can see it in a debug log
if !c.shadow {
log.Printf("[WARN] terraform: shadow graph disabled")
shadow = nil
}
// If we have a shadow graph, walk that as well
var shadowCtx *Context
var shadowCloser Shadow
if c.shadow && shadow != nil {
if shadow != nil {
// Build the shadow context. In the process, override the real context
// with the one that is wrapped so that the shadow context can verify
// the results of the real.
realCtx, shadowCtx, shadowCloser = newShadowContext(c)
}
// Just log this so we can see it in a debug log
if !c.shadow {
log.Printf("[WARN] terraform: shadow graph disabled")
}
log.Printf("[DEBUG] Starting graph walk: %s", operation.String())
walker := &ContextGraphWalker{

View File

@ -23,6 +23,10 @@ import (
const fixtureDir = "./test-fixtures"
func TestMain(m *testing.M) {
// We want to shadow on tests just to make sure the shadow graph works
// in case we need it and to find any race issues.
experiment.SetEnabled(experiment.X_shadow, true)
experiment.Flag(flag.CommandLine)
flag.Parse()