terraform: close transform should not include untargeted providers

This commit is contained in:
Mitchell Hashimoto 2017-02-17 09:27:47 -08:00
parent 9062a1893e
commit ef546517be
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 8 additions and 5 deletions

View File

@ -355,6 +355,13 @@ func (n *graphNodeCloseProvider) DotNode(name string, opts *dag.DotOpts) *dag.Do
} }
} }
// RemovableIfNotTargeted
func (n *graphNodeCloseProvider) RemoveIfNotTargeted() bool {
// We need to add this so that this node will be removed if
// it isn't targeted or a dependency of a target.
return true
}
// graphNodeProviderConsumerDummy is a struct that never enters the real // graphNodeProviderConsumerDummy is a struct that never enters the real
// graph (though it could to no ill effect). It implements // graph (though it could to no ill effect). It implements
// GraphNodeProviderConsumer and GraphNodeSubpath as a way to force // GraphNodeProviderConsumer and GraphNodeSubpath as a way to force

View File

@ -147,11 +147,7 @@ func TestCloseProviderTransformer_withTargets(t *testing.T) {
} }
actual := strings.TrimSpace(g.String()) actual := strings.TrimSpace(g.String())
expected := strings.TrimSpace(` expected := strings.TrimSpace(``)
provider.aws
provider.aws (close)
provider.aws
`)
if actual != expected { if actual != expected {
t.Fatalf("expected:%s\n\ngot:\n\n%s", expected, actual) t.Fatalf("expected:%s\n\ngot:\n\n%s", expected, actual)
} }